Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

prediction_loss_only as an arg #86

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions run_qg.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,9 @@ def main(args_file=None):
mode="training",
using_tpu=training_args.tpu_num_cores is not None
)

# Prediction Loss
training_args.prediction_loss_only=True,

# Initialize our Trainer
trainer = Trainer(
Expand All @@ -185,7 +188,6 @@ def main(args_file=None):
train_dataset=train_dataset,
eval_dataset=valid_dataset,
data_collator=data_collator,
prediction_loss_only=True,
label_smoothing=model_args.label_smoothing
)

Expand All @@ -200,7 +202,7 @@ def main(args_file=None):
trainer.save_model()
# For convenience, we also re-save the tokenizer to the same directory,
# so that you can share your model easily on huggingface.co/models =)
if trainer.is_world_master():
if trainer.is_world_process_zero():
tokenizer.save_pretrained(training_args.output_dir)

# Evaluation
Expand Down Expand Up @@ -233,4 +235,4 @@ def run_qg(args_dict):
main(args_file="args.json")

if __name__ == "__main__":
main()
main()