QwenLM/Qwen-VL

如何用lora微调qwen-vl模型,这个modules_to_save在哪里? chatml

Closed this issue · 3 comments

AssertionError: We detect you are probably using the pretrained model (rather than chat model) for chatting, since the chat_format in generation_config is not "chatml".
If you are directly using the model downloaded from Huggingface, please make sure you are using our "Qwen/Qwen-7B-Chat" Huggingface model (rather than "Qwen/Qwen-7B") when you call model.chat().
我们检测到您可能在使用预训练模型(而非chat模型)进行多轮chat,因为您当前在generation_config指定的chat_format,并未设置为我们在对话中所支持的"chatml"格式。
如果您在直接使用我们从Huggingface提供的模型,请确保您在调用model.chat()时,使用的是"Qwen/Qwen-7B-Chat"模型(而非"Qwen/Qwen-7B"预训练模型)。
这个错误怎么修改?

1、你用chat类的模型进行预训练试下,然后保存模型可以加载
2、修改Qwen-7B的generation_config.json 的"chat_format":为 "chatml",这样也能加载模型,但是我不知道是否有影响,需要官方人员说明下

是的我这样弄的然后训起来了

用lora微调qwen-vl模型,用peft merge_and_unload save_pretrained保存成huggingface模型文件
用Qwen-VL# python web_demo_mm.py加载这个huggingface模型文件进行推理,报错:
assert generation_config.chat_format == 'chatml', _ERROR_BAD_CHAT_FORMAT
AssertionError: We detect you are probably using the pretrained model (rather than chat model) for chatting, since the chat_format in generation_config is not "chatml".
If you are directly using the model downloaded from Huggingface, please make sure you are using our "Qwen/Qwen-7B-Chat" Huggingface model (rather than "Qwen/Qwen-7B") when you call model.chat().
我们检测到您可能在使用预训练模型(而非chat模型)进行多轮chat,因为您当前在generation_config指定的chat_format,并未设置为我 们在对话中所支持的"chatml"格式。
如果您在直接使用我们从Huggingface提供的模型,请确保您在调用model.chat()时,使用的是"Qwen/Qwen-7B-Chat"模型(而非"Qwen/Qwen-7B"预训练模型)。
请问如何修改,谢谢!