Skip to content

swift3.0.3微调qwen2.5-vl-7b报错ValueError: model_type: 'qwen2_5_vl' not in [... #3004

@24-solar-terms

Description

@24-solar-terms

微调qwen2.5-vl-7b
环境:

python 3.10
swift 3.0.3
transformers 4.48.1
torch 2.1.0

根据文档model_type使用qwen2_5_vl
https://swift.readthedocs.io/zh-cn/latest/Instruction/%E6%94%AF%E6%8C%81%E7%9A%84%E6%A8%A1%E5%9E%8B%E5%92%8C%E6%95%B0%E6%8D%AE%E9%9B%86.html

Image

完整训练脚本如下:

CUDA_VISIBLE_DEVICES=0 \
MAX_PIXELS=1073296 \
swift sft \
    --model /huggingface.co/Qwen/Qwen2.5-VL-7B-Instruct \
    --model_type qwen2_5_vl \
    --output_dir /logs/mdocgpt/qwen/debug \
    --dataset /sft_datasets/train.jsonl \
    --val_dataset /sft_datasets/test.jsonl \
    --train_type lora \
    --per_device_train_batch_size 2 \
    --per_device_eval_batch_size 2 \
    --num_train_epochs 10 \
    --save_strategy epoch \
    --gradient_checkpointing_kwargs '{"use_reentrant": false}' \
    --dataloader_num_workers 8

报错:

ValueError: model_type: 'qwen2_5_vl' not in ['emu3_gen', 'emu3_chat', 'baichuan', 'baichuan2', 'modern_bert', 'bert', 'chatglm2', 'chatglm3', 'glm4', 'longwriter_llama3_1', 'codegeex4', 'glm4v', 'cogvlm', 'cogagent_chat', 'cogagent_vqa', 'cogvlm2', 'cogvlm2_video', 'glm_edge', 'glm_edge_v', 'qwen', 'modelscope_agent', 'qwen_audio', 'qwen_vl', 'qwen2', 'qwen2_5', 'qwen2_5_math', 'qwen2_moe', 'qwen2_vl', 'qvq', 'qwen2_audio', 'marco_o1', 'qwq', 'ovis1_6', 'ovis1_6_llama3', 'qwen2_reward', 'qwen2_5_prm', 'qwen2_5_math_reward', 'codefuse_qwen', 'codefuse_codegeex2', 'codefuse_codellama', 'deepseek', 'deepseek_moe', 'deepseek_v2', 'deepseek_v2_5', 'deepseek_vl', 'deepseek_janus', 'deepseek_vl2', 'deepseek_r1', 'deepseek_r1_distill', 'paligemma', 'gemma', 'gemma2', 'internlm', 'internlm2', 'internlm3', 'internvl', 'internvl_phi3', 'internvl2', 'internvl2_phi3', 'internvl2_5', 'xcomposer2_5', 'xcomposer2', 'xcomposer2_4khd', 'xcomposer2_5_ol_audio', 'internlm2_reward', 'llama', 'llama3', 'llama3_1', 'llama3_2', 'llama3_2_vision', 'llama3_1_omni', 'reflection', 'atom', 'mengzi3', 'numina', 'ziya', 'megrez', 'llava_llama3_hf', 'llava1_5_hf', 'llava_onevision_hf', 'llava_next_qwen_hf', 'llama3_llava_next_hf', 'llava1_6_vicuna_hf', 'llava1_6_mistral_hf', 'llava_llama3_1_hf', 'llava1_6_yi_hf', 'llava_next_video_hf', 'llava_next_video_yi_hf', 'llama3_llava_next', 'llava1_6_mistral', 'llava1_6_yi', 'llava_next_qwen', 'grok', 'polylm', 'yuan2', 'orion', 'dbrx', 'bluelm', 'seggpt', 'xverse', 'xverse_moe', 'c4ai', 'aya', 'mamba', 'phi3_vision', 'florence', 'phi3_small', 'phi2', 'phi3', 'phi4', 'phi3_moe', 'minicpm_moe', 'minicpmv', 'minicpmv2_5', 'minicpmv2_6', 'minicpmo2_6', 'minicpm', 'minicpm_chatml', 'minicpm3', 'minimax_vl', 'minimax', 'mistral', 'mixtral', 'mistral_nemo', 'zephyr', 'wizardlm2_moe', 'wizardlm2', 'got_ocr2', 'idefics3', 'pixtral', 'molmoe', 'molmo', 'megrez_omni', 'mplug_owl2', 'mplug_owl2_1', 'mplug_owl3', 'mplug_owl3_241101', 'doc_owl2', 'openbuddy_llama', 'openbuddy_llama3', 'openbuddy_mistral', 'openbuddy_mixtral', 'skywork', 'skywork_o1', 'llama3_2_reward', 'gemma_reward', 'telechat', 'telechat2', 'valley', 'yi_vl', 'yi', 'yi_coder', 'sus']

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions