Fix loading of legacy HuggingFace BERT checkpoints.#10631
Open
drivanov wants to merge 22 commits intopyg-team:masterfrom
Open
Fix loading of legacy HuggingFace BERT checkpoints.#10631drivanov wants to merge 22 commits intopyg-team:masterfrom
drivanov wants to merge 22 commits intopyg-team:masterfrom
Conversation
for more information, see https://pre-commit.ci
…tric into tokenizer # Conflicts: # torch_geometric/datasets/tag_dataset.py
Codecov Report❌ Patch coverage is
❌ Your patch check has failed because the patch coverage (0.00%) is below the target coverage (80.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## master #10631 +/- ##
==========================================
- Coverage 86.11% 84.18% -1.93%
==========================================
Files 496 510 +14
Lines 33655 36017 +2362
==========================================
+ Hits 28981 30321 +1340
- Misses 4674 5696 +1022 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
Contributor
Author
|
@akihironitta: I see exactly the same issues with the code coverage check as in PR#10623. Otherwise, in my opinion, this PR is ready to merge. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Some legacy HuggingFace checkpoints such as
prajjwal1/bert-tinydo not contain aconfig.jsonwith themodel_typefield required by recent versions of Transformers.As a result,
AutoModelForSequenceClassification.from_pretrained()fails with:This PR adds a small fallback for such models by directly using BertForSequenceClassification, while keeping the default AutoModelForSequenceClassification path for all other models.