Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
Jintao-Huang committed Dec 24, 2024
1 parent e236dc8 commit cb8d2bb
Show file tree
Hide file tree
Showing 5 changed files with 60 additions and 0 deletions.
File renamed without changes.
6 changes: 6 additions & 0 deletions examples/train/multimodal/infer.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Perform inference using the validation set from the training phase.
# CUDA_VISIBLE_DEVICES=0,1 \
swift infer \
--adapters output/vx-xxx/checkpoint-xxx \
--stream true \
--load_data_args true
25 changes: 25 additions & 0 deletions examples/train/multimodal/ocr.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# 2*75GB
CUDA_VISIBLE_DEVICES=0,1 \
MAX_PIXELS=1003520 \
swift sft \
--model Qwen/QVQ-72B-Preview \
--dataset AI-ModelScope/LaTeX_OCR:human_handwrite#20000 \
--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 16 \
--eval_steps 50 \
--save_steps 50 \
--save_total_limit 5 \
--logging_steps 5 \
--max_length 2048 \
--output_dir output \
--warmup_ratio 0.05 \
--dataloader_num_workers 4
29 changes: 29 additions & 0 deletions examples/train/multimodal/video.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# 4*80GB
# You can refer to `https://github.com/QwenLM/Qwen2-VL` for the meaning of the `VIDEO_MAX_PIXELS` parameter.
NPROC_PER_NODE=4 \
CUDA_VISIBLE_DEVICES=0,1,2,3 \
VIDEO_MAX_PIXELS=200704 \
FPS_MAX_FRAMES=24 \
swift sft \
--model Qwen/QVQ-72B-Preview \
--dataset swift/VideoChatGPT:all \
--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 4 \
--eval_steps 50 \
--save_steps 50 \
--save_total_limit 5 \
--logging_steps 5 \
--max_length 2048 \
--output_dir output \
--warmup_ratio 0.05 \
--dataloader_num_workers 4 \
--deepspeed zero3
File renamed without changes.

0 comments on commit cb8d2bb

Please sign in to comment.