modelscope / ms-swift

Use PEFT or Full-parameter to finetune 400+ LLMs or 100+ MLLMs. (LLM: Qwen2.5, Llama3.2, GLM4, Internlm2.5, Yi1.5, Mistral, Baichuan2, DeepSeek, Gemma2, ...; MLLM: Qwen2-VL, Qwen2-Audio, Llama3.2-Vision, Llava, InternVL2, MiniCPM-V-2.6, GLM4v, Xcomposer2.5, Yi-VL, DeepSeek-VL, Phi3.5-Vision, ...)
https://swift.readthedocs.io/zh-cn/latest/Instruction/index.html
Apache License 2.0
4.29k stars 377 forks source link

Merging and Exporting Qwen2-VL 7B Instruct Model to Hugging Face Hub After Fine-tuning with LoRA #2126

Open sharonsalabiglossai opened 1 month ago

sharonsalabiglossai commented 1 month ago

I recently fine-tuned the Qwen2-VL 7B Instruct model using LoRA, with the USE_HF=1 environment variable set during fine-tuning. However, I am unable to find a way to merge the fine-tuned model and export it directly to the Hugging Face Hub. The current documentation seems to only provide instructions for exporting the model to ModelScope.

Is there a specific command or procedure to merge the fine-tuned LoRA model and push it to the Hugging Face Hub? Any guidance on this would be appreciated.

marianbasti commented 3 weeks ago

Maybe this?