我可以在本地使用Spacy,以便它可以更新模型吗?
我正在寻找类似的函数,可以从huggingface 示例
基本,我想要,我想要仅使用本地文件,而不要尝试使用模型来查找内容。 因此,当我使用模型时,即使有更新可用,也不会更改,并且我将使用本地的模型。
我尝试使用nlp.to_disk(“ ./ en_example_pipeline”),然后使用spacy.load(“ ./ en_example_pipeline”),但是我不确定如果一个人可以使用该方法,此方法不会更新该模型。文档尚不清楚。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Spacy不会自动自动更新或下载模型。
对于Spacy提供的验证管道,仅当您使用
Spacy下载
命令或相关功能时才会下载它们。在
spacy-Transformers
的特定情况下,该在内部使用HuggingFace Transformers(如果您指定模型并且尚未存在),则将下载。加载模型时,可以检查更新,这取决于拥抱面库和模型实现。模型永远不会自动检查使用Spacy代码的更新,但是
模型可以包含任意代码,因此您可能需要谨慎。 Spacy预算的管道未自动检查以获取更新。
如果您使用的是自己创建的管道,例如使用
nlp.to_disk
,Spacy将无法访问Internet(除非您自己的一个组件之一正在这样做)。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).