From 7299419fe4cb68459bb300ad1c6c2b4885861db0 Mon Sep 17 00:00:00 2001 From: Matthew Honnibal Date: Tue, 28 Jul 2020 21:59:30 +0200 Subject: [PATCH] Dont load vectors in Language.from_config --- spacy/language.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/spacy/language.py b/spacy/language.py index 9fde419b3..3511a7691 100644 --- a/spacy/language.py +++ b/spacy/language.py @@ -1408,8 +1408,10 @@ class Language: nlp = cls( create_tokenizer=create_tokenizer, create_lemmatizer=create_lemmatizer, ) - if config["training"]["vectors"] is not None: - util.load_vectors_into_model(nlp, config["training"]["vectors"]) + # Note that we don't load vectors here, instead they get loaded explicitly + # inside stuff like the spacy train function. If we loaded them here, + # then we would load them twice at runtime: once when we make from config, + # and then again when we load from disk. pipeline = config.get("components", {}) for pipe_name in config["nlp"]["pipeline"]: if pipe_name not in pipeline: