|
#!/usr/bin/env bash |
|
|
|
|
|
export TOKENIZERS_PARALLELISM=false |
|
|
|
|
|
MODEL_ARGS=( |
|
--model_path "THUDM/CogVideoX-5b-I2V" |
|
--model_name "cogvideox-flovd-omsm" |
|
--model_type "i2vFlow" |
|
--training_type "lora" |
|
--additional_save_blocks "patch_embed" |
|
) |
|
|
|
|
|
OUTPUT_ARGS=( |
|
--output_dir "absolute/path/to/output" |
|
--report_to "wandb" |
|
--run_name "CogVideoX_OMSM" |
|
) |
|
|
|
|
|
DATA_ARGS=( |
|
--data_root "absolute/path/to/whole_data" |
|
--caption_column "prompt.txt" |
|
--video_column "videos.txt" |
|
|
|
--train_resolution "49x480x720" |
|
) |
|
|
|
|
|
LORA_ARGS=( |
|
--target_modules "to_q" "to_k" "to_v" "to_out.0" "norm1.linear" "norm2.linear" "ff.net.2" |
|
) |
|
|
|
|
|
TRAIN_ARGS=( |
|
--train_epochs 10 |
|
--seed 42 |
|
--batch_size 1 |
|
--gradient_accumulation_steps 2 |
|
--mixed_precision "bf16" |
|
) |
|
|
|
|
|
SYSTEM_ARGS=( |
|
--num_workers 8 |
|
--pin_memory True |
|
--nccl_timeout 1800 |
|
) |
|
|
|
|
|
CHECKPOINT_ARGS=( |
|
--checkpointing_steps 2000 |
|
--checkpointing_limit 2 |
|
|
|
) |
|
|
|
|
|
VALIDATION_ARGS=( |
|
--do_validation true |
|
--validation_dir "absolute/path/to/whole_data" |
|
--validation_steps 2000 |
|
--validation_prompts "prompts.txt" |
|
--validation_images "images.txt" |
|
--gen_fps 16 |
|
--max_scene 4 |
|
) |
|
|
|
|
|
accelerate launch train.py \ |
|
"${MODEL_ARGS[@]}" \ |
|
"${OUTPUT_ARGS[@]}" \ |
|
"${DATA_ARGS[@]}" \ |
|
"${TRAIN_ARGS[@]}" \ |
|
"${SYSTEM_ARGS[@]}" \ |
|
"${CHECKPOINT_ARGS[@]}" \ |
|
"${VALIDATION_ARGS[@]}" \ |
|
"${LORA_ARGS[@]}" \ |
|
|