diff --git a/sentence_transformers/models/WordEmbeddings.py b/sentence_transformers/models/WordEmbeddings.py index 46f52d013..f0f909b67 100644 --- a/sentence_transformers/models/WordEmbeddings.py +++ b/sentence_transformers/models/WordEmbeddings.py @@ -103,6 +103,10 @@ def from_text_file(embeddings_file_path: str, update_embeddings: bool = False, i iterator = tqdm(fIn, desc="Load Word Embeddings", unit="Embeddings") for line in iterator: split = line.rstrip().split(item_separator) + + if not vocab and len(split) == 2: # Handle Word2vec format + continue + word = split[0] if embeddings_dimension == None: