-
-
Notifications
You must be signed in to change notification settings - Fork 59
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
Loading model using DGMR.from_pretrained("openclimatefix/dgmr") fails #68
Comments
Given that I was baffled that nobody seemed to have reported such a basic problem earlier, I investigated this issue further and, not surprisingly, it is a bit more complicated than I initially though. It turns out the issue surfaced only recently due to changes introduced in pip3 install huggingface-hub==0.21.4 Prior to huggingface/huggingface_hub@45147c5, More relevantly though, if the model class accepts a |
Thanks @agijsberts for finding this. Should we pin the requirements file to Would you be able to expand further on the the |
Pinning Regarding the I volunteer to have a look at what would be the best way to resolve this. |
Thanks @agijsberts, yea if you were able to have a look at the |
I have just pushed the possible Perhaps someone can clarify what the reason is that |
Thanks @agijsberts - have a good holiday, and I look foreward to seeing the PR If Im honest Im not totlaly sure why |
Describe the bug
When loading the pretrained model from HuggingFace as per the instructions in
README.md
I get aKeyError: 'config'
exception. The issue is that when following the instructions**model_kwargs
will be empty inNowcastingModelHubMixin._from_pretrained
, but it then attempts to pass**model_kwargs['config']
to the class constructor inskillful_nowcasting/dgmr/hub.py
Line 154 in 8c40296
To Reproduce
Expected behavior
I expect to have a variable
model
with the pretrainedDGMR
model.Additional context
One can trivially work around the problem by passing an empty
config
argument when loading the pretrained model:so maybe this is just a matter of updating
README.md
.Still, I'd argue that the cleaner fix would be to pass the entire
**model_kwargs
to the class constructor, thusThat would also coincide with how HuggingFace themselves do it in https://github.com/huggingface/huggingface_hub/blob/855ee997202e003b80bafd3c02dac65146c89cc4/src/huggingface_hub/hub_mixin.py#L633.
The text was updated successfully, but these errors were encountered: