From 2c6228565e5abb2727b71c360abb218514e252c5 Mon Sep 17 00:00:00 2001 From: Matthew Honnibal Date: Sun, 18 Dec 2016 23:06:44 +0100 Subject: [PATCH] Fix vector loading re glove hack --- spacy/en/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/spacy/en/__init__.py b/spacy/en/__init__.py index f2b269100..68b694d42 100644 --- a/spacy/en/__init__.py +++ b/spacy/en/__init__.py @@ -52,5 +52,6 @@ def _fix_deprecated_glove_vectors_loading(overrides): vec_path = match_best_version('en_glove_cc_300_1m_vectors', None, data_path) if vec_path is not None: vec_path = vec_path / 'vocab' / 'vec.bin' - overrides['add_vectors'] = lambda vocab: vocab.load_vectors_from_bin_loc(vec_path) + if vec_path is not None: + overrides['add_vectors'] = lambda vocab: vocab.load_vectors_from_bin_loc(vec_path) return overrides