You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Locally saving a TarsModel won't save the huggingface config and therefore requires internet connection & a longer loading time when loading it on a new machine without hf-cache.
This happens due to tars pickeling the internal SequenceTagger/TextClassifier instead of just seralizing their embeddings.
To Reproduce
fromflair.modelsimportTARSClassifiermodel=TARSClassifier.load("tars-base")
model.tars_embeddings.model.config._name_or_path="bert-base-uncased"model.tars_embeddings.base_model_name="bert-base-uncased"model.tars_embeddings.name="transformer-bert-base-uncased"model.save("local-tars-base.pt")
# clear huggingface cache or copy `local-tars-base.pt` to another machine or docker container.model.load("local-tars-base.pt")
Expected behavior
The model should load without the need of internet and it shouldn't require me to wait until the embedding config and weights are downloaded.
Describe the bug
related but not the same as: #3167
Locally saving a TarsModel won't save the huggingface config and therefore requires internet connection & a longer loading time when loading it on a new machine without hf-cache.
This happens due to tars pickeling the internal SequenceTagger/TextClassifier instead of just seralizing their embeddings.
To Reproduce
Expected behavior
The model should load without the need of internet and it shouldn't require me to wait until the embedding config and weights are downloaded.
Logs and Stack traces
Screenshots
No response
Additional Context
No response
Environment
Versions:
Flair
0.12.2 (master branch)
Pytorch
2.0.0+cu117
Transformers
4.28.1
GPU
True
The text was updated successfully, but these errors were encountered: