Skip to content

qwen2.5-omni-7b merge-lora results differ #3756

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

Closed
vra opened this issue Apr 3, 2025 · 0 comments
Closed

qwen2.5-omni-7b merge-lora results differ #3756

vra opened this issue Apr 3, 2025 · 0 comments

Comments

@vra
Copy link

vra commented Apr 3, 2025

Describe the bug
训练了一个qwen2.5-omni微调的模型,infer adapter和merge后的模型,结果不一致

Your hardware and system info
Write your system info like CUDA version/system/GPU/torch version here(在这里给出硬件信息和系统信息,如CUDA版本,系统,GPU型号和torch版本等)
CUDA: 12.2
GPU: NVIDIA GeForce RTX 4090
torch: 2.6.0
ms-swift: 07bd7b4
transformers: f742a644ca32e65758c3adb36225aef1731bd2a8

Additional context
Add any other context about the problem here(在这里补充其他信息)
微调脚本:

# 1*25GB
# A demo for four modalities that can be run directly
nproc_per_node=1

CUDA_VISIBLE_DEVICES=0 \
NPROC_PER_NODE=$nproc_per_node \
VIDEO_MAX_PIXELS=50176 \
FPS_MAX_FRAMES=12 \
MAX_PIXELS=1003520 \
swift sft \
    --model Qwen/Qwen2.5-Omni-7B \
    --dataset 'xxx.jsonl' \
    --train_type lora \
    --torch_dtype bfloat16 \
    --num_train_epochs 1 \
    --per_device_train_batch_size 1 \
    --per_device_eval_batch_size 1 \
    --learning_rate 1e-4 \
    --lora_rank 8 \
    --lora_alpha 32 \
    --target_modules all-linear \
    --freeze_vit true \
    --gradient_accumulation_steps $(expr 1 / $nproc_per_node) \
    --eval_steps 1000 \
    --save_steps 500 \
    --save_total_limit 5 \
    --logging_steps 5 \
    --max_length 2048 \
    --output_dir output \
    --warmup_ratio 0.05 \
    --dataloader_num_workers 4 \
    --deepspeed zero2

lora 测试脚本:

CUDA_VISIBLE_DEVICES=0 \
VIDEO_MAX_PIXELS=50176 \
FPS_MAX_FRAMES=12 \
MAX_PIXELS=1003520 \
swift infer \
    --adapter output/v15-20250403-090934/checkpoint-500\
    --stream true \
    --load_data_args true \
    --max_new_tokens 2048

lora测试结果:

q: 你最喜欢的电影?
a: 哪吒2

merge后测试脚本:

CUDA_VISIBLE_DEVICES=0 \
VIDEO_MAX_PIXELS=50176 \
FPS_MAX_FRAMES=12 \
MAX_PIXELS=1003520 \
swift infer \
    --model output/v15-20250403-090934/checkpoint-500-merged\
    --stream true \
    --load_data_args true \
    --max_new_tokens 2048

merge后测试结果:

q: 你最喜欢的电影?
a: 肖生克的救赎
@Jintao-Huang Jintao-Huang added bug Something isn't working and removed bug Something isn't working labels Apr 3, 2025
@vra vra closed this as completed May 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants