Files
modelscope/examples/pytorch/text_generation/run_train.sh
hemu.zp 8c13f9107f add finetune_text_generation
1. Add TrainingArgs and cli call form for text generation task
2. Fix dp+tp finetune bug
Link: https://code.alibaba-inc.com/Ali-MaaS/MaaS-lib/codereview/11929345

(cherry picked from commit eecdd90412)
2023-03-10 15:09:32 +08:00

23 lines
773 B
Bash

DATA_PARALLEL_SIZE=2
TENSOR_MODEL_PARALLEL_SIZE=2
WORLD_SIZE=$(($DATA_PARALLEL_SIZE * $TENSOR_MODEL_PARALLEL_SIZE))
PYTHONPATH=. torchrun --nproc_per_node $WORLD_SIZE examples/pytorch/text_generation/finetune_text_generation.py \
--trainer 'nlp-gpt3-trainer' \
--work_dir './tmp' \
--model 'damo/nlp_gpt3_text-generation_1.3B' \
--dataset_name 'chinese-poetry-collection' \
--preprocessor 'text-gen-jieba-tokenizer' \
--src_txt 'text1' \
--tgt_txt 'text2' \
--max_epochs 3 \
--per_device_train_batch_size 16 \
--lr 3e-4 \
--lr_scheduler 'noam' \
--eval_metrics 'ppl' \
--world_size $WORLD_SIZE \
--tensor_model_parallel_size $TENSOR_MODEL_PARALLEL_SIZE \
# --dataset_name 'DuReader_robust-QG' \ # input&output