git-cloner / llama2-lora-fine-tuning

llama2 finetuning with deepspeed and lora
https://gitclone.com/aiit/chat/
MIT License
162 stars 14 forks source link

请教关于微调 #2

Closed goog closed 1 year ago

goog commented 1 year ago

我使用了30m的6w数据, 在A10 上面微调 微调参数和你的差不多 batch size 32 , 24小时, 结果还是回答不了好中文。请问有没有什么建议和经验分享下

little51 commented 1 year ago

建议如下: 1、A10看能否装入llama-2-7b-chat全精度的模型或13b的模型训练 2、6w的语料是足够了,确认一下这6w里中文的语料占比 3、llama-2-7b-chat这个模型微调中文效果不好,扩充中文词典也无改善,建议用llama-2-7b原始模型微调,微调方法见:https://github.com/git-cloner/Llama2-chinese ,效果尚可,即使是用8bit精度训练,用4bit推理,生成中文也是没问题的,效果见:https://gitclone.com/aiit/chat/ ,A10可用以用全精度、半精度或13B微调,效果应会更好

goog commented 1 year ago

我参考你的知乎博文来的, --use_fp16 使用了 请问你是在aliyun还是自己的平台训练的。我微调loss输出0.44附件

little51 commented 1 year ago

在自己的平台上训练的,两块P100(16G)。不同的推理卡,参数会有一些区别,得按情况调整,在P100、Cuda117上,用不用use_fp16区别不是很大

goog commented 1 year ago

好的 了解了。generate.py 的input 需要带格式吗? 直接提问如“知道顾城吗” 有问题?

little51 commented 1 year ago

不带格式