export PYTHONPATH=$PYTHONPATH:/home/shiym/projects/MedM-VL

deepspeed --include localhost:0,1,2,3 --master_port 29501 lvlm/train.py \
    --deepspeed examples/zero2.json \
    --lvlm_llm_type phi \
    --lvlm_llm_name_or_path microsoft/phi-2 \
    --lvlm_llm_max_length 3072 \
    --lvlm_llm_padding_side right \
    --lvlm_llm_attn_implementation flash_attention_2 \
    --lvlm_encoder_image_type siglip \
    --lvlm_encoder_image_name_or_path google/siglip-so400m-patch14-384 \
    --lvlm_encoder_image_select_layer -1 \
    --lvlm_encoder_image_select_feature cls_patch \
    --lvlm_connector_image_type mlp \
    --lvlm_connector_image_name mlp2x_gelu \
    --data_path /hdd/shiym/datasets_processed/MedM-VL/llava/pretrain_llava.json \
    --conv_version pretrain \
    --image_dir /hdd/shiym/datasets/0_public/LLaVA/LLaVA-Pretrain/images \
    --training_recipe common \
    --tune_type_llm frozen \
    --tune_type_encoder_image frozen \
    --tune_type_connector_image full \
    --output_dir /hdd/shiym/work_dirs/MedM-VL/TinyLLaVA-phi2-siglip-pretrain \
    --num_train_epochs 1 \
    --per_device_train_batch_size 32 \
    --gradient_accumulation_steps 2 \
    --learning_rate 1e-3 \
    --lr_scheduler_type cosine \
    --warmup_ratio 0.03 \
    --weight_decay 0.0 \
    --fp16 True \
    --dataloader_num_workers 8 \
    --dataloader_pin_memory True \
    --dataloader_persistent_workers True \
    --gradient_checkpointing True \
    --logging_strategy steps \
    --logging_steps 1 \
    --report_to tensorboard \
    --eval_strategy no \
    --save_strategy no
