datawhalechina / self-llm

《开源大模型食用指南》基于Linux环境快速部署开源大模型,更适合中国宝宝的部署教程
Apache License 2.0
8.24k stars 986 forks source link

ChatGLM3-6B微调后成哑巴了(字面意思) #65

Closed Tangent-90C closed 6 months ago

Tangent-90C commented 6 months ago

今天按照https://github.com/datawhalechina/self-llm/blob/master/ChatGLM/06-ChatGLM3-6B-Lora%E5%BE%AE%E8%B0%83.md 的教程微调ChatGLM3-6B,结果微调时loss突然归0,后续让微调后的模型回答问题,更是一言不发,一个token都没生成就原样返回……

image

Python 3.10.8 相关库的版本:

Package                        Version
------------------------------ ---------------
accelerate                     0.28.0
datasets                       2.18.0
peft                           0.9.0
torch                          2.1.2+cu121
transformers                   4.38.2
KMnO4-zx commented 6 months ago

ChatGLM3模型,仓库文件改动频繁,需要时间定位问题,建议按照本项目readme中的学习建议,优先学习Qwen模型

Tangent-90C commented 6 months ago

试了下,peft降级0.6.0就行了

KMnO4-zx commented 6 months ago

image ke'neng'shi可能是高版本兼容性不太好

Tangent-90C commented 5 months ago

我去peft提了issue,目前发现是peft>=0.7.0就会出现这个问题,临时解决办法是把模型权重改成bf16或者fp32 https://github.com/huggingface/peft/issues/1568#issuecomment-2047853722