Views
No views yet
1from modeling_chatglm import ChatGLMForConditionalGeneration
2import torch
3
4
5torch.set_default_tensor_type(torch.cuda.HalfTensor)
6model = ChatGLMForConditionalGeneration.from_pretrained("THUDM/chatglm-6b", trust_remote_code=True, device_map='auto')1from peft import PeftModel
2
3model = PeftModel.from_pretrained(model, "visual-openllm/visual-openllm-chatglm-6b-rola")
4torch.set_default_tensor_type(torch.cuda.FloatTensor)