-
Notifications
You must be signed in to change notification settings - Fork 5.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
经过sft或者dpo后,合并lora后导出的gguf,在ollama上回答效果不佳 #6020
Comments
有同样的问题不知道是不是自己操作的问题?vllm推理的时候是没有问题的 生成gguf文件后再倒入到ollama中回答效果总是有问题 |
遇到同样的问题,有解决嘛 |
找到问题啦,是template的问题,你在微调时候用的什么template,在ollama 配置Modelfile的时候就要写什么样的template,我是微调的qwen,你们参考下(注释里面的东西我也没仔细看)。
|
我微调的Meta-Llama-3.1-8B-Instruct,用的llama3的模板,那Modelfile文件是直接复制llama3的模版就行,是吧? |
都可以,只要是对应的模板就行,多试试,去源码template里面找对应模板代码也试试,也可以参考这位大佬的llm-templates |
试了几个都达不到LLama-Factory官方代码预测结果的效果,你知道官方的llama3模版是怎么定义的嘛 @NeilL0412 @hiyouga |
去ollama library找,或者你微调时用的什么template,那就去源码template.py找对应的代码,转成template格式。如果还是不行那我也没办法了,好好去看文档吧…… |
Reminder
System Info
llamafactory
version: 0.9.1.dev0Reproduction
使用的模型是Qwen/Qwen2.5-1.5B-Instruct
经过了6次sft微调,每次epoch 30次,合并lora模型后的回答效果还可以,但是转换成gguf后的回答效果差很多。
以下是合并后的lora模型:
以下是在ollama上运行,导出的gguf:

微调的参数大概是这样的:
合并lora的参数:
经过前6次sft微调,第7次进行dpo强化学习
以下是合并后lora模型的回答:
以下是在ollama上运行的gguf,总是像以下这种问答选项的这种形式:

以下是合并lora参数:
导出的参数与sft差不多,这里就不贴了
还请各位大佬帮忙看一下是什么情况,还请各位帮忙说一下可能出现这种问题的原因和解决方法都有哪些,谢谢
Expected behavior
No response
Others
No response
The text was updated successfully, but these errors were encountered: