diff --git a/spacy/tests/util.py b/spacy/tests/util.py index 56aeb5223..2f474a926 100644 --- a/spacy/tests/util.py +++ b/spacy/tests/util.py @@ -79,9 +79,9 @@ def add_vecs_to_vocab(vocab, vectors): """Add list of vector tuples to given vocab. All vectors need to have the same length. Format: [("text", [1, 2, 3])]""" length = len(vectors[0][1]) - vocab.resize_vectors(length) + vocab.clear_vectors(length) for word, vec in vectors: - vocab[word].vector = vec + vocab.set_vector(word, vec) return vocab