htlou's picture
Upload folder using huggingface_hub
5f3fc63 verified
#!/usr/bin/env bash
#
# Copyright 2024 PKU-Alignment Team. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================
export TRITON_CACHE_DIR="/aifs4su/yaodong/cache/triton"
# You can replace it with a local model path
MODEL_NAME_OR_PATH="/aifs4su/yaodong/models/Qwen2-VL-7B-Instruct"
# You can replace it with a local dataset path
TRAIN_DATASETS="/aifs4su/yaodong/datasets/aaa_dataset/TV2T-preference/extracted"
EVAL_DATASETS="/aifs4su/yaodong/datasets/ShareGPTVideo/extracted/split"
# You can replace it with a new path
OUTPUT_DIR="../outputs/dpo_tiv2t_10k_baseline"
# For wandb online logging
export WANDB_API_KEY="547f38af44135ca76a4f4eed9c8d135532da4960"
# Source the setup script
source ./setup.sh
export CUDA_HOME=$CONDA_PREFIX
# Execute deepspeed command
deepspeed \
--hostfile ./host9 \
--master_port ${MASTER_PORT} \
--module align_anything.trainers.tiv_to_t.dpo \
--model_name_or_path ${MODEL_NAME_OR_PATH} \
--train_datasets ${TRAIN_DATASETS} \
--output_dir ${OUTPUT_DIR} \
--train_data_files extracted_preference_10k_washed.json \
--train_template NExTQA_preference \
--train_split 'train' \
--per_device_train_batch_size 1 \
--per_device_eval_batch_size 1 \
--gradient_accumulation_steps 1