Update README.md
Browse files
README.md
CHANGED
@@ -59,7 +59,7 @@ import sys
|
|
59 |
from peft import PeftModel
|
60 |
from transformers import AutoModel, AutoTokenizer
|
61 |
sys.path.append('..')
|
62 |
-
model = AutoModel.from_pretrained("THUDM/chatglm-6b",
|
63 |
model = PeftModel.from_pretrained(model, "model/chatglm_fitness_lora")#"model/chatglm_fitness_lora"为您下载本项目压缩包后,解压后本地lora目录
|
64 |
model = model.half().cuda() # fp16
|
65 |
tokenizer = AutoTokenizer.from_pretrained("THUDM/chatglm-6b", trust_remote_code=True)
|
@@ -125,7 +125,7 @@ import sys
|
|
125 |
from peft import PeftModel
|
126 |
from transformers import AutoModel, AutoTokenizer
|
127 |
sys.path.append('..')
|
128 |
-
model = AutoModel.from_pretrained("fb700/chatglm-fitness-RLHF",
|
129 |
#model = PeftModel.from_pretrained(model, "model/chatglm_fitness_lora") # lora文件保存目录
|
130 |
model = model.half().quantize(4).cuda() # int4
|
131 |
#model = model.half().quantize(8).cuda() # int8
|
|
|
59 |
from peft import PeftModel
|
60 |
from transformers import AutoModel, AutoTokenizer
|
61 |
sys.path.append('..')
|
62 |
+
model = AutoModel.from_pretrained("THUDM/chatglm-6b", device_map='auto')
|
63 |
model = PeftModel.from_pretrained(model, "model/chatglm_fitness_lora")#"model/chatglm_fitness_lora"为您下载本项目压缩包后,解压后本地lora目录
|
64 |
model = model.half().cuda() # fp16
|
65 |
tokenizer = AutoTokenizer.from_pretrained("THUDM/chatglm-6b", trust_remote_code=True)
|
|
|
125 |
from peft import PeftModel
|
126 |
from transformers import AutoModel, AutoTokenizer
|
127 |
sys.path.append('..')
|
128 |
+
model = AutoModel.from_pretrained("fb700/chatglm-fitness-RLHF", device_map='auto')#fb700/chatglm-fitness-RLHF为hg自动下载地址,如已经自行下载请替换
|
129 |
#model = PeftModel.from_pretrained(model, "model/chatglm_fitness_lora") # lora文件保存目录
|
130 |
model = model.half().quantize(4).cuda() # int4
|
131 |
#model = model.half().quantize(8).cuda() # int8
|