Skip to content

Commit

Permalink
Fix inheritance chain for load_word2vec_format (return correct clas…
Browse files Browse the repository at this point in the history
…s in case when you create an child class based on kv) (#1968)

* fix the inheritance chain

* make same change for Poincare
  • Loading branch information
DennisChen0307 authored and menshikh-iv committed Mar 9, 2018
1 parent bfb33ff commit 2ee7a2c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion gensim/models/keyedvectors.py
Original file line number Diff line number Diff line change
Expand Up @@ -1115,7 +1115,7 @@ def load_word2vec_format(cls, fname, fvocab=None, binary=False, encoding='utf8',
"""
# from gensim.models.word2vec import load_word2vec_format
return _load_word2vec_format(
Word2VecKeyedVectors, fname, fvocab=fvocab, binary=binary, encoding=encoding, unicode_errors=unicode_errors,
cls, fname, fvocab=fvocab, binary=binary, encoding=encoding, unicode_errors=unicode_errors,
limit=limit, datatype=datatype)

def get_keras_embedding(self, train_embeddings=False):
Expand Down
2 changes: 1 addition & 1 deletion gensim/models/poincare.py
Original file line number Diff line number Diff line change
Expand Up @@ -869,7 +869,7 @@ def load_word2vec_format(cls, fname, fvocab=None, binary=False, encoding='utf8',
"""
return _load_word2vec_format(
PoincareKeyedVectors, fname, fvocab=fvocab, binary=binary, encoding=encoding, unicode_errors=unicode_errors,
cls, fname, fvocab=fvocab, binary=binary, encoding=encoding, unicode_errors=unicode_errors,
limit=limit, datatype=datatype)

@staticmethod
Expand Down

0 comments on commit 2ee7a2c

Please sign in to comment.