id-align / scripts /train /same_config_w_vicuna_finetune.sh
zooblastlbz's picture
Upload folder using huggingface_hub
a9e1e1a verified
### !/bin/bash
set -x
nnodes=1
num_gpus=8
DATA_ROOT='/jizhicfs/bojoli'
DATA_PATH=${DATA_ROOT}/llava-next-data/llava-next-data.json
IMAGE_FOLDER=${DATA_ROOT}/llava-next-data/images
VISION_TOWER_NAME='clip-vit-large-patch14-336'
MODEL_NAME='vicuna-7b-1.5'
VISION_TOWER=${DATA_ROOT}/${VISION_TOWER_NAME}
MODEL_PATH=${DATA_ROOT}/${MODEL_NAME}
BASE_RUN_NAME='final_without_mmpe'_${MODEL_NAME}'_'${VISION_TOWER_NAME}
RUN_NAME='final_without_mmpe_finetune'_${MODEL_NAME}'_'${VISION_TOWER_NAME}
deepspeed --num_nodes ${nnodes} --num_gpus ${num_gpus} --master_port=10271 llava/train/train_mem.py \
--deepspeed ./scripts/zero3.json \
--model_name_or_path ${MODEL_PATH} \
--version v1 \
--data_path ${DATA_PATH} \
--image_folder ${IMAGE_FOLDER} \
--pretrain_mm_mlp_adapter ./checkpoints/${BASE_RUN_NAME}/mm_projector.bin \
--unfreeze_mm_vision_tower True \
--mm_vision_tower_lr 2e-6 \
--vision_tower ${VISION_TOWER} \
--mm_projector_type mlp2x_gelu \
--mm_vision_select_layer -2 \
--mm_use_im_start_end False \
--use_mmpe False \
--mm_use_im_patch_token False \
--group_by_modality_length True \
--image_aspect_ratio anyres \
--mm_patch_merge_type spatial_unpad \
--bf16 True \
--image_grid_pinpoints "[(672,672),(336, 672), (672, 336), (336, 1008),(1008,336),(336,1344),(1344,336)]" \
--output_dir ./checkpoints/${RUN_NAME} \
--num_train_epochs 1 \
--per_device_train_batch_size 8 \
--per_device_eval_batch_size 4 \
--gradient_accumulation_steps 2 \
--evaluation_strategy "no" \
--save_strategy "steps" \
--save_steps 1000 \
--save_total_limit 1 \
--learning_rate 2e-5 \
--weight_decay 0. \
--warmup_ratio 0.03 \
--lr_scheduler_type "cosine" \
--logging_steps 1 \
--tf32 True \
--model_max_length 4096 \
--gradient_checkpointing True \
--dataloader_num_workers 4 \
--lazy_preprocess True \
--report_to none \
--run_name ${RUN_NAME}