Skip to content
Discussion options

You must be logged in to vote

After packaging, you want to install the model and then load it from the package name rather than the path. The included code is only loaded automatically if you load from an installed package.

The actual names will be different but it looks something like this, look for the .tar.gz or .whl in the dist/ subdirectory:

spacy package /path/to/model_name /output_dir
pip install /output_dir/en_model_name-0.0.0/dist/en_model_name-0.0.0.tar.gz

Then:

nlp = spacy.load("en_model_name")

If you load from a path, you'll still need to import the additional code in an extra step before loading the model.

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@hkodela1
Comment options

@adrianeboyd
Comment options

@hkodela1
Comment options

@wjbmattingly
Comment options

Answer selected by adrianeboyd
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 feat / cli Feature: Command-line interface
3 participants