From 4a38a26cb58e957b9905918adcac6b61e2feb530 Mon Sep 17 00:00:00 2001 From: Matthew Honnibal Date: Tue, 3 Jul 2018 22:57:11 +0200 Subject: [PATCH] Fix init_model --- spacy/cli/init_model.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spacy/cli/init_model.py b/spacy/cli/init_model.py index 70c3a4334..17a99f2e2 100644 --- a/spacy/cli/init_model.py +++ b/spacy/cli/init_model.py @@ -68,8 +68,8 @@ def init_model(lang, output_dir, freqs_loc=None, clusters_loc=None, jsonl_loc=No lex_attrs = read_attrs_from_deprecated(freqs_loc, clusters_loc) vectors_loc = ensure_path(vectors_loc) if vectors_loc and vectors_loc.parts[-1].endswith('.npz'): - vector_data = numpy.load(vectors_loc.open('rb')) - vectors_keys = [lex['orth'] for lex in lex_attrs if 'id' in lex] + vectors_data = numpy.load(vectors_loc.open('rb')) + vector_keys = [lex['orth'] for lex in lex_attrs if 'id' in lex] else: vectors_data, vector_keys = read_vectors(vectors_loc) if vectors_loc else (None, None) nlp = create_model(lang, lex_attrs, vectors_data, vector_keys, prune_vectors)