Skip to content

Commit

Permalink
Merge pull request huggingface#10 from ROCmSoftwarePlatform/bert-tf2
Browse files Browse the repository at this point in the history
 Adding evaluation mode to script.
  • Loading branch information
stevenireeves committed Feb 22, 2022
2 parents 25329fb + 8c0d82a commit 8112f21
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 3 additions & 1 deletion scripts/bert/bert_train.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,6 @@ def tokenize_function(examples):
)

print("==================================== Evaluating Model =================================")
model.fit(train_tf_dataset, validation_data=eval_tf_dataset, epochs=3)
model.fit(train_tf_dataset, validation_data=eval_tf_dataset, epochs=1)
info = model.evaluate(eval_tf_dataset, verbose=2)

3 changes: 2 additions & 1 deletion scripts/bert/bert_train.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ set -x
pip3 install transformers datasets


cd ~ && git clone --branch bert-tf2 https://github.com/ROCmSoftwarePlatform/transformers
cd ~ && git clone https://github.com/ROCmSoftwarePlatform/transformers
cd ~
# Script to train the small 117M model
python3 transformers/scripts/bert/bert_train.py > log.txt
cat log.txt | tail -n 1
Expand Down

0 comments on commit 8112f21

Please sign in to comment.