Skip to content
Discussion options

You must be logged in to vote

When you initialize a model with English() it doesn't have any pipeline components, so it doesn't know to load them when you call from_disk(). If you add the right pipeline components and then run from_disk(), it will deserialize any that are in the current pipeline. See the example here: https://spacy.io/usage/saving-loading#pipeline

There can be cases where you want to handle things differently, but in general you probably want to use spacy.load() to load models, since it takes care of these details for you. The docs are here: https://spacy.io/api/top-level#spacy.load and you can see what it's doing underneath here:

spaCy/spacy/util.py

Lines 194 to 222 in 2d71545

def load_mo…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by ines
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat / serialize Feature: Serialization, saving and loading
2 participants