Can I use spaCy locally so it dosent update model?

Viewed 39

Im looking for a similar function to run spaCy offline like this one from huggingFaceexample

basiclly, i want to use local files only and not try to look things up whan using a model. So when i use a model it will not change even if there is an update avilable and i will use the model i have locally.

i have tried using nlp.to_disk("./en_example_pipeline") and then using spacy.load("./en_example_pipeline") but I'm not sure that this method will not update the model if one is avilable. the docs are not clear.

1 Answers

spaCy does not automatically update or download models on its own.

For pretrained pipelines provided by spaCy, they are only downloaded if you use the spacy download command or related functions.

In the specific case of spacy-transformers, which uses HuggingFace Transformers internally, if you specify a model and it's not present already, it will be downloaded. When a model is loaded it may be checked for updates, it depends on the HuggingFace library and the model implementation.

Models are never automatically checked for updates by spaCy code, but models can contain arbitrary code, so you may need to be careful about that. spaCy's pretrained pipelines are not automatically checked for updates.

If you are using a pipeline you created yourself, like with nlp.to_disk, spaCy won't access the Internet (unless one of your own components is doing that).

Related