modelscope / swift

ms-swift: Use PEFT or Full-parameter to finetune 300+ LLMs or 50+ MLLMs. (Qwen2, GLM4v, Internlm2.5, Yi, Llama3.1, Llava-Video, Internvl2, MiniCPM-V, Deepseek, Baichuan2, Gemma2, Phi3-Vision, ...)
https://swift.readthedocs.io/zh-cn/latest/
Apache License 2.0
2.58k stars 231 forks source link

Langchain-Chatchat部署训练后的模型后推理异常 #794

Open WSC741606 opened 3 months ago

WSC741606 commented 3 months ago

Describe the bug rsLoRA微调yi-6B-chat,Swift的web ui和命令行infer都正常,但fastchat后端启动后推理乱码 image 对于LoRA微调yi-6B-chat的没有遇到这种情况 微调后都merge-lora合并过权重了

Your hardware and system info 3090单卡vllm推理

Additional context https://github.com/chatchat-space/Langchain-Chatchat

tastelikefeet commented 2 months ago

一般来说推理没有问题则模型结构和ckpt应该是没有问题的。 建议使用peft和automodel来加载模型进行推理,如果没问题说明问题不是框架原因,如果有问题可以贴一下结果

WSC741606 commented 2 months ago

嗯嗯,所以感觉很邪门,我猜是词表映射的问题 使用peft和automodel来加载模型进行推理有示例代码吗,我试试~

zhensuiyi commented 2 months ago

我跟你遇到同样的问题,使用的框架也是一样的,后来你有解决么

tastelikefeet commented 2 months ago

https://www.modelscope.cn/models/01ai/Yi-6B-Chat/summary 参考示例代码就行

WSC741606 commented 2 months ago

我跟你遇到同样的问题,使用的框架也是一样的,后来你有解决么

@zhensuiyi 我采用的方案是swift deploy一个Fastchat后端,修改Langchain的openAI接口接到这个后端使用,原生的加载我没解决

WSC741606 commented 2 months ago

https://www.modelscope.cn/models/01ai/Yi-6B-Chat/summary 参考示例代码就行

好嘞,我试试

zhensuiyi commented 2 months ago

@WSC741606 能贴一下你用swift部署后,访问的api么。我这边用swift进行部署也部署成功了,但是访问有报错

WSC741606 commented 2 months ago

@WSC741606 能贴一下你用swift部署后,访问的api么。我这边用swift进行部署也部署成功了,但是访问有报错 @zhensuiyi


"openai-api": {
"model_name": "yi-6b-chat", #在API的list models里显示的名字
"api_key": "Null",  #随便写
"api_base_url": "http://本机IP:端口号/v1",  
},