`from_pretrained` doesn't validate its kwargs
See original GitHub issuesplitting off from https://github.com/huggingface/transformers/issues/13895
AutoModel.from_pretrained(mname, reviison=ckpt) # dyslexic typist
Throws no exception and it definitely should, since this could be unnoticed for a long time and meanwhile the user gets incorrect behavior.
Expected behavior:
There should be an assert if a user passes an argument that is not expected by the function.
Issue Analytics
- State:
- Created 2 years ago
- Comments:16 (15 by maintainers)
Top Results From Across the Web
model.generate doesn't validate kwargs · Issue #18130 - GitHub
Feature request I made a mistake in a script: model.generate(**tokens, in_length=num_tokens) missing m in min_length and I was puzzling over ...
Read more >Models - Hugging Face
If a configuration is not provided, kwargs will be first passed to the configuration class initialization function (from_pretrained()). Each key of kwargs that ......
Read more >TFBertMainLayer gets less accuracy compared to TFBertModel
It seems like the version calling TFBertMainLayer isn't loading the pre-trained weights for the model, which could explain the decrease in ...
Read more >TypeError: forward() got an unexpected keyword argument ...
I'm not sure how the error message fits the posted code, but based on the failure it seems that net doesn't recognize the...
Read more >bert model save_pretrained | The AI Search Engine You Control
I think it doesn't make sense that the code looks for config.json in function from_pretrained while there is no config.json generated when function ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
on the server side, 403 rather than 404 leaks info because you can “discover” repo names for instance. That’s why 404 is commonly used (on GitHub, etc)
So here we have a bit of a chicken and egg problem, the args that are needed to get to the hub aren’t validated until after the files are successfully fetched. I understand.
So it’d be the same issue with misspelled
revision
- it’d ignore it, and give the user themain
branch instead. And then fail if there is actually a model undermain
. It was failing for us in a different way since we didn’t have anything undermain
(different repo:bigscience/tr3d-1B3-oscar-checkpoints
). All checkpoints were in branches. That explains why it was failing then and not reporting a misspelled kwargs.That’s quite the conundrum for the 2 kwargs then:
revision
anduse_auth_token
(not sure if there are other critical ones).