-
-
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
I am not able load a module from my local disk after download from huggingface #2626
Comments
I manage to unzip the bin file, i had pkl file and data directories. how to go from here ? i tried to load UnpicklingError: A load persistent id instruction was encountered,vbut no persistent_load function was specified. Any idea |
Hi @wassimsuleiman, I recently faced a similiar problem on a machine without internet access and found the following workaround:
Note: If you simply want to store the model for a later offline usage on the same computer, you can skip step 2. to 4. Maybe somebody can contribute a more elegant solution but for now this at least works. |
Hey @pg020196 you can use the current master branch, then it will work out of the box, if you redownload the model |
Hi @helpmefindaname, thank you for your reply! Sorry for another need for clarification on my side: If i understand your comment correctly, you are referring to the master branch of the flair project and not of the master branch of the hugging face model, aren't you? Currently, I am using the latest package available through pip (flair 0.10). Do I still have to initially download the model using In my case, I cannot use the Thank you! |
Hi @pg020196 yes I refer to the master branch of flair. As you cannot do that on your target device, you need to install flair on a different device and run the load/save once there. |
Hi @helpmefindaname, |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Hello @helpmefindaname @pg020196 , could you please mention the load and save steps which need to be followed once the model is downloaded? |
Hi @ksachdeva11, to save the model you can simply use the Loading a model is shown here, e.g. loading a SequenceTagger can be done by calling: |
Hi @pg020196 , I am following below steps -
but getting this error - Is it not the right way to do load and save? |
Hi @ksachdeva11, When loading the model with |
thanks @pg020196 ... getting this error now while saving the model..
|
@ksachdeva11 sorry, unfortunately I can't help you with this issue. Did you make sure that the model was fully and correctly loaded, meaning that you can make predictions? If not, I would recommend to check out the examples, they are really useful. Otherwise the only thing I can point out is that I tried all of the above steps with python 3.9, torch 1.11.0 and flair 0.11. Maybe there are some dependency issues with other versions. Additionally you could try another model and see if the issue still exists to narrow down the options. |
@pg020196 updating the flair version to 0.11 helped. Thanks a lot! |
It's still not working and it kept trying to connect even though I have all the necessary files on the PC |
i downloaded the module from huggingface
https://huggingface.co/flair/ner-english-ontonotes-large/tree/main
i am trying to load the SequenceTagger
tagger = SequenceTagger.load('./pytorch_model.bin')
i got:
ValueError: Connection error ?
Any idea
The text was updated successfully, but these errors were encountered: