Upload janus_editing.sh with huggingface_hub
Browse files- janus_editing.sh +42 -0
janus_editing.sh
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Copyright 2025 PKU-Alignment Team. All Rights Reserved.
|
| 2 |
+
#
|
| 3 |
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
| 4 |
+
# you may not use this file except in compliance with the License.
|
| 5 |
+
# You may obtain a copy of the License at
|
| 6 |
+
#
|
| 7 |
+
# http://www.apache.org/licenses/LICENSE-2.0
|
| 8 |
+
#
|
| 9 |
+
# Unless required by applicable law or agreed to in writing, software
|
| 10 |
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
| 11 |
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 12 |
+
# See the License for the specific language governing permissions and
|
| 13 |
+
# limitations under the License.
|
| 14 |
+
# ==============================================================================
|
| 15 |
+
# Initialize variables
|
| 16 |
+
export CUDA_VISIBLE_DEVICES=0,1
|
| 17 |
+
MODEL_NAME_OR_PATH="/data5/czh/pretrain_models/Janus-Pro-1B"
|
| 18 |
+
TRAIN_DATASETS="/home/czh/bxh/align-anything/projects/janus/example/supervised/text_to_image"
|
| 19 |
+
TRAIN_DATA_FILE="train_unify.pt"
|
| 20 |
+
EVAL_DATASETS="/home/czh/bxh/align-anything/projects/janus/example/supervised/text_to_image"
|
| 21 |
+
EVAL_DATA_FILE="train_unify.pt"
|
| 22 |
+
OUTPUT_DIR="/home/czh/bxh/janus_sft_text_to_image"
|
| 23 |
+
JANUS_REPO_PATH="/home/czh/bxh/Align_Anything_Janus" # change to your own path to Align_Anything_Janus
|
| 24 |
+
|
| 25 |
+
export PYTHONPATH=$PYTHONPATH:$JANUS_REPO_PATH
|
| 26 |
+
export WANDB_API_KEY="744522a73a6fd3ff6b9d0c40506a080b194aa628"
|
| 27 |
+
export WANDB_MODE=offline
|
| 28 |
+
|
| 29 |
+
# Source the setup script
|
| 30 |
+
source ../setup.sh
|
| 31 |
+
# Execute deepspeed command
|
| 32 |
+
deepspeed \
|
| 33 |
+
--master_port 29000 \
|
| 34 |
+
--module align_anything.trainers.janus.sft_gen \
|
| 35 |
+
--model_name_or_path ${MODEL_NAME_OR_PATH} \
|
| 36 |
+
--train_datasets ${TRAIN_DATASETS} \
|
| 37 |
+
--train_data_files ${TRAIN_DATA_FILE} \
|
| 38 |
+
--train_split train \
|
| 39 |
+
--learning_rate 1e-6 \
|
| 40 |
+
--epochs 3 \
|
| 41 |
+
--lr_scheduler_type cosine \
|
| 42 |
+
--output_dir ${OUTPUT_DIR}
|