|
#!/bin/bash |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
TASK=tnews |
|
DATA_ROOT_PATH=./data |
|
DATA_DIR=$DATA_ROOT_PATH/$TASK |
|
|
|
PRETRAINED_MODEL_PATH=IDEA-CCNL/Erlangshen-UniMC-RoBERTa-110M-Chinese |
|
|
|
CHECKPOINT_PATH=./checkpoint |
|
|
|
LOAD_CHECKPOINT_PATH=./checkpoints/last.ckpt |
|
|
|
OUTPUT_PATH=./predict/${TASK}_predict.json |
|
|
|
DEFAULT_ROOT_DIR=./log |
|
|
|
DATA_ARGS="\ |
|
--data_dir $DATA_DIR \ |
|
--train_data train.json \ |
|
--valid_data dev.json \ |
|
--test_data test1.1.json \ |
|
--batchsize 1 \ |
|
--max_length 512 \ |
|
" |
|
|
|
|
|
|
|
MODEL_ARGS="\ |
|
--learning_rate 0.000002 \ |
|
--weight_decay 0.1 \ |
|
--warmup 0.06 \ |
|
" |
|
|
|
MODEL_CHECKPOINT_ARGS="\ |
|
--monitor val_acc \ |
|
--save_top_k 3 \ |
|
--mode max \ |
|
--every_n_train_steps 100 \ |
|
--save_ckpt_path $CHECKPOINT_PATH \ |
|
--filename model-{epoch:02d}-{val_acc:.4f} \ |
|
" |
|
|
|
TRAINER_ARGS="\ |
|
--max_epochs 17 \ |
|
--gpus 1 \ |
|
--check_val_every_n_epoch 1 \ |
|
--val_check_interval 100 \ |
|
--gradient_clip_val 0.25 \ |
|
--default_root_dir $DEFAULT_ROOT_DIR \ |
|
" |
|
|
|
|
|
|
|
options=" \ |
|
--pretrained_model_path $PRETRAINED_MODEL_PATH \ |
|
--output_path $OUTPUT_PATH \ |
|
--train \ |
|
$DATA_ARGS \ |
|
$MODEL_ARGS \ |
|
$MODEL_CHECKPOINT_ARGS \ |
|
$TRAINER_ARGS \ |
|
" |
|
|
|
SCRIPT_PATH=./solution/clue_unimc.py |
|
python3 $SCRIPT_PATH $options |
|
|
|
|