我可以在本地使用Spacy,以便它可以更新模型吗?

发布于 2025-02-11 08:26:00 字数 335 浏览 2 评论 0原文

我正在寻找类似的函数,可以从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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

小红帽 2025-02-18 08:26:00

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).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文