htlou commited on
Commit
7935981
·
verified ·
1 Parent(s): f788cf6

Upload folder using huggingface_hub

Browse files
Files changed (1) hide show
  1. script.sh +51 -0
script.sh ADDED
@@ -0,0 +1,51 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+
20
+ MODEL_NAME_OR_PATH="/aifs4su/yaodong/hantao/models/llava-v1.6-mistral-7b-hf" # model path
21
+
22
+ # HOSTFILE="/aifs4su/yaodong/hantao/align-anything/scripts/.hostfile"
23
+
24
+ for DATASET_NAME in ${DATASETS_NAME[@]}; do
25
+ TRAIN_DATASETS="/aifs4su/yaodong/hantao/datasets/AA_preference_cosi/val/merged/${DATASET_NAME}" # dataset path
26
+ TRAIN_TEMPLATE="AA_TI2T_LLAVA" # dataset template
27
+ TRAIN_NAME="text-image-to-text" # dataset name
28
+ TRAIN_SPLIT="train" # split the dataset
29
+
30
+ OUTPUT_DIR="../outputs/llava_1.6_mistral_7b_val/${DATASET_NAME}" # output dir
31
+
32
+ # For wandb online logging
33
+ export WANDB_API_KEY="7e2dcc0c310ebcb7cdcafd5e9320d6be55cf1a33"
34
+
35
+ # Source the setup script
36
+ source ./setup.sh
37
+
38
+ # Execute deepspeed command
39
+ deepspeed \
40
+ --master_port ${MASTER_PORT} \
41
+ --module align_anything.trainers.text_image_to_text.dpo \
42
+ --model_name_or_path ${MODEL_NAME_OR_PATH} \
43
+ --train_datasets ${TRAIN_DATASETS} \
44
+ --train_template ${TRAIN_TEMPLATE} \
45
+ --train_split ${TRAIN_SPLIT} \
46
+ --train_name ${TRAIN_NAME} \
47
+ --output_dir ${OUTPUT_DIR} \
48
+ --save_total_limit 12 \
49
+ --train_batch_size 8 \
50
+ --epochs 3
51
+ done