mymusise / ChatGLM-Tuning

基于ChatGLM-6B + LoRA的Fintune方案
MIT License
3.71k stars 444 forks source link

Finetune前后预测结果Answer都是?? ??这样的 #213

Open LeiShenVictoria opened 1 year ago

LeiShenVictoria commented 1 year ago

求问在V100上,利用alpaca数据集finetune前后进行infer的时候,Answer:都是??是什么原因呢

Instruction: Describe the structure of an atom. Answer: ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ 3.Answer: An atom is made up of a nucleus, which contains protons and neutrons, surrounded by electrons that travel in orbits around the nucleus. The protons and neutrons have a positive charge, while the electrons have a negative charge, resulting in an overall neutral atom. The number of each particle determines the atomic number and the type of atom.

surviveMiao commented 1 year ago

我也是这个现象,兄弟你训练了多少轮?

berryjwang commented 1 year ago

我这边也出现了这个现象,参照官网的,改了下面代码就好了: 原代码: model = AutoModel.from_pretrained("THUDM/chatglm-6b", trust_remote_code=True, load_in_8bit=True, device_map='auto') tokenizer = AutoTokenizer.from_pretrained("THUDM/chatglm-6b", trust_remote_code=True) 修改后的为: model = AutoModel.from_pretrained("THUDM/chatglm-6b", trust_remote_code=True) tokenizer = AutoTokenizer.from_pretrained("THUDM/chatglm-6b", trust_remote_code=True).half().cuda()

LeiShenVictoria commented 1 year ago

我也是这个现象,兄弟你训练了多少轮?

按照默认参数训练的,推理的时候改成如下内容成功了: model = AutoModel.from_pretrained("THUDM/chatglm-6b", load_in_8bit=False, trust_remote_code=True, device_map="auto").half() tokenizer = AutoTokenizer.from_pretrained("THUDM/chatglm-6b", trust_remote_code=True)

GromZhang commented 1 year ago

我也是这个现象,兄弟你训练了多少轮?

按照默认参数训练的,推理的时候改成如下内容成功了: model = AutoModel.from_pretrained("THUDM/chatglm-6b", load_in_8bit=False, trust_remote_code=True, device_map="auto").half() tokenizer = AutoTokenizer.from_pretrained("THUDM/chatglm-6b", trust_remote_code=True)

大佬,我按照你的说法,不使用8bit加载,但是运行之后报错 RuntimeError: expected scalar type Half but found Float 我的卡也是v100,v100好像不支持8bit的量化,能否指点一下

AI-Study-Han commented 1 year ago

我的也是V100,修改成model = AutoModel.from_pretrained("THUDM/chatglm-6b", trust_remote_code=True, load_in_8bit=False, device_map='auto').half().cuda()就可以了

dongdongzhaoUP commented 2 days ago

我的也是V100,修改成model = AutoModel.from_pretrained("THUDM/chatglm-6b", trust_remote_code=True, load_in_8bit=False, device_map='auto').half().cuda()就可以了 我是a100,不加.half().cuda()报错RuntimeError: expected scalar type Half but found Float,加了全是 ??