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

Not always consider a local model a checkpoint in run_glue #10517

Merged
merged 1 commit into from
Mar 4, 2021

Conversation

sgugger
Copy link
Collaborator

@sgugger sgugger commented Mar 4, 2021

What does this PR do?

In the run_glue script, a local model is automatically considered a checkpoint (which is there to enable users to do --model_path_or_name path_to_specific_checkpoint) but when using a local model, it can crash if the number of labels is different (cf #10502). This PR fixes that by checking the number of labels inside the potential checkpoint before passing it to the Trainer. Another possible fix is to check for the presence of files like trainer_state.json` (but this only works if the checkpoint was created with a recent version of Transformers).

Fixes #10502

@sgugger sgugger requested a review from LysandreJik March 4, 2021 14:49
Copy link
Member

@LysandreJik LysandreJik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@LysandreJik LysandreJik merged commit a5bd40b into master Mar 4, 2021
@LysandreJik LysandreJik deleted the fix_10502 branch March 4, 2021 16:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

GLUE benchmark crashes with MNLI and STSB
2 participants