Skip to content
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

多模态模型DPO微调时的报错 #1853

Closed
dszpr opened this issue Aug 29, 2024 · 3 comments
Closed

多模态模型DPO微调时的报错 #1853

dszpr opened this issue Aug 29, 2024 · 3 comments

Comments

@dszpr
Copy link

dszpr commented Aug 29, 2024

Describe the bug
What the bug is, and how to reproduce, better with screenshots(描述bug以及复现过程,最好有截图)
我采用自己的数据集运行InternVL2-8B的DPO微调,数据集的格式严格按照文档中的{"query": "11111", "response": "22222", "rejected_response": "33333", "images": ["image_path"]}构建。
训练脚本为:
#!/bin/bash

export CUDA_VISIBLE_DEVICES=1,2,3,4
NPROC_PER_NODE=4

OUTPUT_DIR='/workspace/code/LLaVA/work_dirs/ft/internvl2-8b-ft-4epoch-lora-v1.1.2-dpo'

if [ ! -d "$OUTPUT_DIR" ]; then
mkdir -p "$OUTPUT_DIR"
fi

torchrun --nproc_per_node ${NPROC_PER_NODE} /usr/local/lib/python3.8/dist-packages/swift/cli/rlhf.py
--rlhf_type dpo
--beta 0.1
--sft_beta 0.1
--model_type internvl2-8b
--model_id_or_path /workspace/code/LLaVA/work_dirs/internvl2-8b-ft-math-4epoch-full-v1.1.2/internvl2-8b/v4-20240829-180950/checkpoint-170/
--dataset /workspace/vlm_dataset/train_v1.1.2_dpo_8b_swift_v1.json
--max_length 8192
--sft_type lora
--output_dir ${OUTPUT_DIR}
--batch_size 4
--num_train_epochs 1
--learning_rate 2e-5
--weight_decay 0.
--warmup_ratio 0.03
--lr_scheduler_type cosine
--save_strategy epoch
--evaluation_strategy no
报错为
image

Your hardware and system info
Write your system info like CUDA version/system/GPU/torch version here(在这里给出硬件信息和系统信息,如CUDA版本,系统,GPU型号和torch版本等)

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

@dszpr
Copy link
Author

dszpr commented Aug 29, 2024

已解决,max_lenth设为16384

@dszpr dszpr closed this as completed Aug 29, 2024
@ljqnb
Copy link

ljqnb commented Aug 31, 2024

你好我也遇到这问题,改了之后也没有解决,能问下您的数据格式吗,十分感谢!

@dszpr
Copy link
Author

dszpr commented Sep 2, 2024

你好我也遇到这问题,改了之后也没有解决,能问下您的数据格式吗,十分感谢!

数据格式就是按照官方手册中的格式,{"query": "11111", "response": "22222", "rejected_response": "33333", "images": ["image_path"]},我是一个sample一张图片,如果你是多张图片的话,max_lenth应该还得继续加

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