Upload folder using huggingface_hub
Browse files
script.sh
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/usr/bin/env bash
|
| 2 |
+
#
|
| 3 |
+
# Copyright 2025 PKU-Alignment Team. All Rights Reserved.
|
| 4 |
+
#
|
| 5 |
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
| 6 |
+
# you may not use this file except in compliance with the License.
|
| 7 |
+
# You may obtain a copy of the License at
|
| 8 |
+
#
|
| 9 |
+
# http://www.apache.org/licenses/LICENSE-2.0
|
| 10 |
+
#
|
| 11 |
+
# Unless required by applicable law or agreed to in writing, software
|
| 12 |
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
| 13 |
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 14 |
+
# See the License for the specific language governing permissions and
|
| 15 |
+
# limitations under the License.
|
| 16 |
+
# ==============================================================================
|
| 17 |
+
|
| 18 |
+
# DATASETS_NAME=("q1-10" "q1-20" "q1-30" "q1-40" "q1-50" "q1-60" "q1-70" "q1-80" "q1-90" "q1-100")
|
| 19 |
+
DATASETS_NAME=("q1-10")
|
| 20 |
+
|
| 21 |
+
MODEL_NAME_OR_PATH="/aifs4su/yaodong/hantao/models/llava-v1.6-mistral-7b-hf" # model path
|
| 22 |
+
|
| 23 |
+
# HOSTFILE="/aifs4su/yaodong/hantao/align-anything/scripts/.hostfile"
|
| 24 |
+
|
| 25 |
+
for DATASET_NAME in ${DATASETS_NAME[@]}; do
|
| 26 |
+
TRAIN_DATASETS="/aifs4su/yaodong/hantao/datasets/AA_preference_cosi/val/merged/${DATASET_NAME}" # dataset path
|
| 27 |
+
TRAIN_TEMPLATE="AA_TI2T_LLAVA" # dataset template
|
| 28 |
+
TRAIN_NAME="text-image-to-text" # dataset name
|
| 29 |
+
TRAIN_SPLIT="train" # split the dataset
|
| 30 |
+
|
| 31 |
+
OUTPUT_DIR="../outputs/llava_1.6_mistral_7b_val/${DATASET_NAME}" # output dir
|
| 32 |
+
|
| 33 |
+
# For wandb online logging
|
| 34 |
+
export WANDB_API_KEY="7e2dcc0c310ebcb7cdcafd5e9320d6be55cf1a33"
|
| 35 |
+
|
| 36 |
+
# Source the setup script
|
| 37 |
+
source ./setup.sh
|
| 38 |
+
|
| 39 |
+
# Execute deepspeed command
|
| 40 |
+
deepspeed \
|
| 41 |
+
--master_port ${MASTER_PORT} \
|
| 42 |
+
--module align_anything.trainers.text_image_to_text.dpo \
|
| 43 |
+
--model_name_or_path ${MODEL_NAME_OR_PATH} \
|
| 44 |
+
--train_datasets ${TRAIN_DATASETS} \
|
| 45 |
+
--train_template ${TRAIN_TEMPLATE} \
|
| 46 |
+
--train_split ${TRAIN_SPLIT} \
|
| 47 |
+
--train_name ${TRAIN_NAME} \
|
| 48 |
+
--output_dir ${OUTPUT_DIR} \
|
| 49 |
+
--save_total_limit 12 \
|
| 50 |
+
--train_batch_size 8 \
|
| 51 |
+
--epochs 3
|
| 52 |
+
done
|