Skip to content

Commit

Permalink
docstirng fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
piskvorky committed Sep 7, 2020
1 parent d524fa4 commit 49b35b7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions gensim/models/fasttext.py
Original file line number Diff line number Diff line change
Expand Up @@ -1218,8 +1218,10 @@ def _load_specials(self, *args, **kwargs):
if not isinstance(self, FastTextKeyedVectors):
raise TypeError("Loaded object of type %s, not expected FastTextKeyedVectors" % type(self))
if not hasattr(self, 'compatible_hash') or self.compatible_hash is False:
raise TypeError("Pre-gensim-3.8.x Fasttext models with nonstandard hashing are no longer compatible."
"Loading into gensim-3.8.3 & re-saving may create a compatible model.")
raise TypeError(
"Pre-gensim-3.8.x fastText models with nonstandard hashing are no longer compatible. "
"Loading your old model into gensim-3.8.3 & re-saving may create a model compatible with gensim 4.x."
)
if not hasattr(self, 'vectors_vocab_lockf') and hasattr(self, 'vectors_vocab'):
self.vectors_vocab_lockf = ones(1, dtype=REAL)
if not hasattr(self, 'vectors_ngrams_lockf') and hasattr(self, 'vectors_ngrams'):
Expand Down
2 changes: 1 addition & 1 deletion gensim/models/word2vec.py
Original file line number Diff line number Diff line change
Expand Up @@ -1819,7 +1819,7 @@ def save(self, *args, **kwargs):
super(Word2Vec, self).save(*args, **kwargs)

def _save_specials(self, fname, separately, sep_limit, ignore, pickle_protocol, compress, subname):
"""Arrange any special handling for the gensim.utils.SaveLoad protocol"""
"""Arrange any special handling for the `gensim.utils.SaveLoad` protocol."""
# don't save properties that are merely calculated from others
ignore = set(it.chain(ignore, ('cum_table',)))
return super(Word2Vec, self)._save_specials(
Expand Down

0 comments on commit 49b35b7

Please sign in to comment.