2

How to use the fine-tuned bert pytorch model for classification (CoLa) task?

I do not see the argument --do_predict, in /examples/run_classifier.py.

However, --do_predict exists in the original implementation of the Bert.

The fine-tuned model is getting saving in the BERT_OUTPUT_DIR as pytorch_model.bin, but is there a simple way to reuse it through the command line?

Using Pytorch implementation from: https://github.com/huggingface/pytorch-pretrained-BERT

The command which I am using to execute the code is:

python run_classifier.py \
  --task_name CoLA \
  --do_train \
  --do_eval \
  --do_lower_case \
  --data_dir ./split/ \
  --bert_model bert-base-uncased \
  --max_seq_length 128 \
  --train_batch_size 32 \
  --learning_rate 2e-5 \
  --num_train_epochs 3.0 \
Ashwin Geet D'Sa
  • 6,346
  • 2
  • 31
  • 59
  • Which library/code are you using? Which version of the library/code? What's the full command that you've tried to run? And what's the error output you see from the command? – alvas May 15 '19 at 14:30
  • The problem is, I am not able to use the run_classifier.py for prediction. However, the original implementation of the BERT https://github.com/google-research/bert , has a `--do_predict` flag, which can be used for the purpose of prediction on test data-set – Ashwin Geet D'Sa May 15 '19 at 14:37

0 Answers0