-
-
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]: Training a Model Results in an OSError Related to Model Loading #3167
Comments
It worked once when I moved the code from a Jupyter notebook to a .py file, but now it stopped working again. It fails with the same error in the .py file. |
same here. Did you find any workaround? |
Hello, when is the error thrown? At the end of training? |
@maylad31 The only thing I was able to do to get it working was to downgrade to |
Hi @ynusinovich can you share the full stacktrace? |
Okay I think I happen to find the exact same bug, the full stacktrace is the following:
That found, it is simple to reproduce the error with the following code: from flair.models import TARSClassifier
model = TARSClassifier.load("tars-base")
model.save("local-tars-base.pt")
new_model = TARSClassifier.load("local-tars-base.pt") # here the error happens. Setting a breakpoint in the shows that the TarsClassifier saves the following HuggingfaceConfig:
notice, that About using the model, you can hotfix by manually setting the following attributes directly after loading:
|
@ynusinovich thanks for the temporary workaround. The stacktrace shared above is exactly what i get. |
Describe the bug
When I am creating a few shot learning model by finetuning tars-base, the model crashes after training without saving to my local drive like it's supposed to.
To Reproduce
Expected behaivor
I would expect the model to save to the folder.
Logs and Stack traces
Screenshots
No response
Additional Context
The training completed all epochs before crashing.
The code I used was from your tutorial page. It has worked in the past.
Environment
Versions:
Flair
0.12.1
Pytorch
1.13.1
Transformers
4.25.1
GPU
False
The text was updated successfully, but these errors were encountered: