question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Revisions not working as expected

See original GitHub issue

We were getting a size mismatch when loading a finetuned checkpoint. After looking at the model config, I found that it had been updated and that the embedding/vocab size had increased. This is slightly annoying but not the core of this issue. My way of dealing with this, then, was naturally to rely on version control and simply use the previous commit which still had the config that we used for finetuning (this one). I would have expected that I can then load this revised model with the commit as given on the website:

from transformers import AutoModel

model_name = "GroNLP/bert-base-dutch-cased"
revision = "61330c1"
model = AutoModel.from_pretrained(model_name, revision=revision)

This does not work an throws an error that the model cannot be found with the following message:

OSError: Can't load config for 'GroNLP/bert-base-dutch-cased'. Make sure that:

- 'GroNLP/bert-base-dutch-cased' is a correct model identifier listed on 'https://huggingface.co/models'

- or 'GroNLP/bert-base-dutch-cased' is the correct path to a directory containing a config.json file

A first improvement would be to add to this error message something about revisions, because obviously GroNLP/bert-base-dutch-cased is a correct name. The deeper issue is that the model revision is simply not found when I use the commit tag on the website. By coincidence I noticed that the URL includes a much longer identifier that starts with the commit number that you can see on the website (the full commit hash). When you try that, the code does run and the revision is correctly loaded.

from transformers import AutoModel

model_name = "GroNLP/bert-base-dutch-cased"
revision = "61330c1ca1aa3a688f8aa015059142a1b20d3f63"
model = AutoModel.from_pretrained(model_name, revision=revision)

So the bug is either

  • the model is not capable of looking up a revision based on the first seven characters of a hash (not sure if it should/could),
  • or the model hub website does not provide enough information to make this intuitive for users.

One way that would help, for instance, is that the “use in transformers” button adapts itself to the current revision that a user is browsing and when clicked it includes the revision (if any) in the example usage. And/or a copy function can be added to the commit identifier that - when clicked - does copies the whole hash.

Who can help

Note sure who to tag for the model page so tagging @sgugger and @LysandreJik

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:11 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
julien-ccommented, Oct 21, 2021

Hey @BramVanroy (and @sgugger) we solved this through better UX, actually:

if you take a look at commit history on https://huggingface.co/bert-base-uncased/commits/main you now have buttons to copy the full commit hash (exactly like on GitHub), thanks to @beurkinger on the Hub team.

see screenshot below:

Screenshot 2021-10-21 at 18 51 05

Hope this helps!

1reaction
LysandreJikcommented, Aug 25, 2021

Hi @BramVanroy, thanks for opening an issue! This is also tracked in https://github.com/huggingface/huggingface_hub/issues/197 cc @julien-c @Pierrci

There’s definitely an improvement to be done regarding the mention of the revision in the error message, feel free to give it a try if you have the time to, otherwise we’ll take care of it ASAP.

Read more comments on GitHub >

github_iconTop Results From Across the Web

'Not the expected Revision' displays in the Inventor tooltip after ...
Solution: This is working as expected as the released assembly is linked to the released revision/version of the part. To solve this the ......
Read more >
Easily Fix WordPress Revisions Not Showing Issue
WordPress revisions are useful for retrieving old versions of your posts and pages. WordPress revisions not showing? We have an easy fix for...
Read more >
Revision GC not functioning as expected #12341 - GitHub
My Knative Service traffic block is configured with latestRevision: true . My config-gc ConfigMap is configured as follows. max-non-active-revisions: "3 ...
Read more >
Revision Option is Missing from Classic Editor | WordPress.org
It is expected behaviour if you are using the Database Optimization. You can find what exactly is being removed in the info box...
Read more >
"Create new revision" option is ignored when updating ...
Save. Go to revision tab and observe the new revision was in fact created. Go back to node edit form.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found