-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
[Bug]: automatic HF Model Upgrade breaking code #3193
Comments
Hello @Mumpitz this unfortunately is a known issue (see #3187) that was caused by the torch 2.0 update. I fixed it for some models, but that also caused other problems. Since resources are limited, it might take a bit before this is fully fixed. In the meantime, your best option is to either use an older torch version (anything before 2.0) or use one of the "large" models (like ner-english-large) which can also do at least some multilingual inference. We are also working on newer and better multilingual models, so at some point in the future, these will also be released. |
We define a custom cache_root, so we have the older models saved locally. Would be nice to have the possibility to check for available Versions and pick a specific one, but checking would need Hugging Face to provide a proper API for this. Did not find something like this so far. I'd like to be able to load a model and on error fall back to an earlier version that worked and notify me about that. |
Hm looking at this now, perhaps best would be to revert to the previous model. This will break all torch 2.0 code, but at least existing code would work again. Could you test whether https://huggingface.co/flair/ner-german is working in your setup? I also updated this model but I think this one should work. |
Hi, However, @Mumpitz you can load old revisions from the HF-hub, e.g. |
Actually the The @-Style is something i wasn't aware of so far. Is this what is specified after the dot in the Filename, or where does it come from? My current loading looks as follows, where the loaded_taggers['ner-multi'] = MultiTagger.load(
'resources/.flair/models/ner-multi/a25dcf292992753787b66a693ab5fd5d03444c2b1494fd39c9be6a07d14aa0b7'
'.b7085be4373491dc725f55b30bea1ba20458e692558435c2f3ea1366277bd8bc'
) My new thought would be, to specify it as |
So thinking about a loading mechanism, i came up with the idea of using the HfApi Before loading a model, check the Does this make sense some how? |
Thanks for leaving the buggy code up on HF that completely breaks people's venv and still doesn't work. gj |
Describe the bug
Recently the
flair/ner-multi
Model on Hugging Face was updated, which broke the loading with Flair v0.11.3.The Upgrade of the Model happened automatically and broke some production code and even the Hugging Face Inference API has issues with the new Model.
I could not see a way to pin the Model Version to v0.8.0, which is working with the older Flair Versions prior to v0.12.x.
To Reproduce
Expected behavior
Tagger loads successfully an be used to predict Senteces or do other Stuff.
Logs and Stack traces
Screenshots
No response
Additional Context
No response
Environment
Dev System Versions:
Flair
0.11.3
Pytorch
1.13.0
Transformers
4.24.0
GPU
False
Production System Versions:
Flair
0.11.3
Pytorch
1.13.0+cu117
Transformers
4.24.0
GPU
True
The text was updated successfully, but these errors were encountered: