# | |
# 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. | |
# ============================================================================== | |
# Initialize variables | |
# For wandb online logging | |
export WANDB_API_KEY="547f38af44135ca76a4f4eed9c8d135532da4960" | |
export NCCL_P2P_LEVEL=NVL | |
# Source the setup script | |
source ./setup.sh | |
ACTOR_MODEL_NAME_OR_PATH="/aifs4su/yaodong/models/Qwen2-VL-7B-Instruct" | |
CRITIC_MODEL_NAME_OR_PATH="/aifs4su/yaodong/projects/hantao/dev_cham/align-anything/outputs/rm_tiv2t_10k_baseline" | |
REWARD_MODEL_NAME_OR_PATH="/aifs4su/yaodong/projects/hantao/dev_cham/align-anything/outputs/rm_tiv2t_10k_baseline" | |
TRAIN_DATASETS="/aifs4su/yaodong/datasets/aaa_dataset/TV2T-preference/extracted" | |
PTX_DATASETS="/aifs4su/yaodong/datasets/ShareGPT4Video/extracted" | |
OUTPUT_DIR="../outputs/ppo_qwen2vl_10k_baseline" | |
# Source the setup script | |
source ./setup.sh | |
# Execute deepspeed command | |
deepspeed \ | |
--hostfile ./host10 \ | |
--master_port ${MASTER_PORT} \ | |
--module align_anything.trainers.tiv_to_t.ppo \ | |
--actor_model_name_or_path ${ACTOR_MODEL_NAME_OR_PATH} \ | |
--reward_model_name_or_path ${REWARD_MODEL_NAME_OR_PATH} \ | |
--reward_critic_model_name_or_path ${CRITIC_MODEL_NAME_OR_PATH} \ | |
--train_datasets ${TRAIN_DATASETS} \ | |
--train_template NExTQA_preference \ | |
--train_data_files extracted_preference_10k_washed.json \ | |
--train_split 'train' \ | |
--ptx_datasets ${PTX_DATASETS} \ | |
--ptx_data_files extracted_panda.json \ | |
--ptx_template NExTQA \ | |
--ptx_split 'train' \ | |
--output_dir ${OUTPUT_DIR} \ | |
--ddp_timeout 18000000000 \ | |
--save_interval 300 | |