-
Notifications
You must be signed in to change notification settings - Fork 7.1k
[model] Add Qwen2.5-Omni #7537
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
[model] Add Qwen2.5-Omni #7537
Conversation
有没有一些数据例子能快跑一些?提供个几条测试数据?(各种模态的) |
@Harryjun 上面提供了。 |
音频微调有BUG:已经提了issue:#7552 |
请问模型支持全参数微调么? |
支持 |
我试了一下全参数训练,用单张A100去训练,会报显存不足的错误,用8张A100使用deepspeed去训练,会报 |
i have successfully ran the lora and get the ckpt, but at merging i got:
I have already did this:
|
|
Looking in indexes: https://mirrors.ivolces.com/pypi/simple/ 一直卡在这里 没有反应 |
pip install -U transformers即可 |
但是这样下载的是transformers==4.52.4, transformers中没有 Qwen2_5OmniModel,只有Qwen2_5OmniForConditionalGeneration; |
有 |
* preserve image_sizes * preserve image_sizes * init plugin * support audio-text2text lora * nit * support image/video-text2text, audio-text2text * remove args * remove lines * add docs && nit * remove some comments * fix && add merge part script * add license
我已经更新了最新的transformers==4.52.4,成功merge了权重,然而并没有找到你上面例子中给出的Qwen2_5OmniModel |
是的 |
您好,就是我现在有一个问题, 我前天安装了训练环境训练qwen-omni,但是我仍然使用的是pip install git+https://github.com/Kuangdd01/transformers.git@qwen25omni这个transformers版本进行的训练,因为训练时间比较长,我今天合并之后,发现没有办法使用官方的transformers和vllm进行推理。 请问我可以直接升级transformers版本,然后进行合并来支持使用官方的transformers和vllm进行推理吗 |
具体是什么报错呢,vllm的报错吗 |
抱歉打扰您。我的具体情况是这样的, 我在6月11号下载了LLaMafactory的代码,但是使用的transformers的版本是用的git+https://github.com/Kuangdd01/transformers.git@qwen25omni的,因为我们没有关注最新的issue。在Omni上进行了全量的sft训练之后,对模型进行了merge。然后我们准备用vllm对该模型进行推理, vllm版本我们没有使用最新的版本,使用的0.8.5.post1, 使用的transformers版本是https://github.com/huggingface/transformers@v4.51.3-Qwen2.5-Omni-preview(使用这两个版本是因为我们用这些版本可以走完Omni的训练和推理流程), 我们不清楚是否因为这些代码在这段时间发生了更改。 现在的情况是,在推理时,vllm可以正常加载原始Qwen-Omni模型,但是用vllm加载merge之后的模型( a=LLM(model="/home/export/base/ycsc_lijt1/lijt1/online1/lxb/LLaMA-Factory/saves/0611_Omni_text/10_criteria_66k/final"))会报错 ”ValueError: Qwen2_5OmniForConditionalGeneration has no vLLM implementation and the Transformers implementation is not compatible with vLLM. Try setting VLLM_USE_V1=0.“ 。 我们目前很疑惑,为什么可以正常加载Omni但是加载sft并merge之后的Omni就会报这个错误。 |
我们解决这个问题了, 在使用vllm加载合并之后的模型时,需要将合并之后的模型中config的architectures字段从”Qwen2_5OmniForConditionalGeneration“手动改成”Qwen2_5OmniModel“,这样vllm就可以直接加载了。 |
好的 我记录一下 |
这个architecture的变化是SFT的过程中产生的吗?能否在merge脚本中修改arch,避免手动步骤? |
最新版的transfomrers代码中移除了 |
使用最新的代码,sft还是会报错:LLaMA-Factory/src/llamafactory/data/mm_plugin.py", line 179, in _validate_input
|
@crystalww 若遇到类似 from transformers import AutoProcessor
processor = AutoProcessor.from_pretrained("Qwen/Qwen2.5-Omni-7B") |
Qwen2.5-Omni 微调支持 audio+text 2 audio+text吗?如果支持,数据格式是怎么样的 |
暂不支持audio decoder部分的微调 |
您好,请问Qwen2.5-Omni微调只要输出是音频就不支持是吗,但是这个模型不是语音端到端,微调输出文本的不就失去部分端到端的优势了吗?因为需要在输出文本后再加个TTS转成音频。 |
没办法构造raw audio到codec_ids的映射关系,那么就不能端到端进行训练了,具体可以看talker generation的代码,实际上音频的输出也是要等thinker部分的generated text再生成的,我们暂时只提供一个训练模型在下游任务微调thinker的能力,对于talker部分涉及到很多loss,包括codec ids的ce loss, dit部分的loss以及wave 部分的mse loss很难进行构建 |
您好,感谢回复,请问我可以理解为Qwen2.5-Omni本身开源程度是允许对输出音频进行微调,但是就算不用LlamaFactory微调,用其他工具对输出音频进行微调都比较复杂,所以暂时没有人做出来是吗? |
|
# for lora
python3 ./scripts/qwen_omni_merge.py merge_lora \
--base_model_path="./Qwen2_5Omni" \
--lora_checkpoint_path="./lora_checkpoint" \
--save_path="./target_dir" 可以加入模型合并后的量化吗? |
请问qwen2.5 omni支持多轮对话微调吗 |
请问模型能不能不合并,直接以lora的加载方式进行推理呢 |
vllm目前不支持该模型这样推理。 |
What does this PR do?
This PR aims to support the fine-tuning/post-training of the
Thinker
part of the latest Qwen2.5-Omni model.Env Info
# prepare transformers with the following cmd pip install -U transformers
TODO List
These tests were done with
lora
anddemo
data setups with freezingaudio tower
&vision tower
.Test recipes
Checkpoint Merging
Currently, we have updated the scripts for merging lora weights of
thinker
model or merging full weights ofthinker
model.Usage below:
Then try the official inference pipeline:
Fixes #7504 (issue)
For Finetuning with data
video + audio
Refer to #7638 for data preparation and turn
use_audio_in_video
totrue
For vllm serve
Warning
After loading the merged model using vllm, you need to manually change the architectures field in the model's config file from
Qwen2_5OmniForConditionalGeneration
toQwen2_5OmniModel
. After this change, vllm can load it automatically.Before submitting