Skip to content

Commit

Permalink
Makeing script more flexible (#4681)
Browse files Browse the repository at this point in the history
Added missing vars

Author:    Jacek Czaja <jacek.czaja@intel.com>
  • Loading branch information
jczaja committed Jun 3, 2020
1 parent b0239e3 commit 856c428
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions PaddleNLP/sentiment_classification/run.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,18 @@ TASK_NAME='senta'
DATA_PATH=./senta_data/
CKPT_PATH=./save_models
MODEL_PATH=./save_models/step_1800/
MODEL_TYPE=${MODEL_TYPE:-bilstm_net}
USE_CUDA=${USE_CUDA:-true}

# run_train on train.tsv and do_val on test.tsv
train() {
python -u run_classifier.py \
--task_name ${TASK_NAME} \
--use_cuda true \
--use_cuda $USE_CUDA \
--do_train true \
--do_val false \
--do_infer false \
--model_type $MODEL_TYPE \
--batch_size 8 \
--data_dir ${DATA_PATH} \
--vocab_path ${DATA_PATH}/word_dict.txt \
Expand All @@ -33,10 +36,11 @@ train() {
evaluate() {
python -u run_classifier.py \
--task_name ${TASK_NAME} \
--use_cuda true \
--use_cuda $USE_CUDA \
--do_train false \
--do_val true \
--do_infer false \
--model_type $MODEL_TYPE \
--batch_size 10 \
--data_dir ${DATA_PATH} \
--vocab_path ${DATA_PATH}/word_dict.txt \
Expand All @@ -48,10 +52,11 @@ evaluate() {
infer() {
python -u run_classifier.py \
--task_name ${TASK_NAME} \
--use_cuda true \
--use_cuda $USE_CUDA \
--do_train false \
--do_val false \
--do_infer true \
--model_type $MODEL_TYPE \
--batch_size 10 \
--data_dir ${DATA_PATH} \
--vocab_path ${DATA_PATH}/word_dict.txt \
Expand Down

0 comments on commit 856c428

Please sign in to comment.