Skip to content

Commit

Permalink
Allow training if model is not modified by "_minimize_model". Add dep…
Browse files Browse the repository at this point in the history
…recation warning. (#1207)
  • Loading branch information
chinmayapancholi13 authored and tmylk committed Mar 12, 2017
1 parent 2faeb33 commit dd396e3
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions gensim/models/word2vec.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@
from collections import defaultdict
import threading
import itertools
import warnings

from gensim.utils import keep_vocab_item, call_on_class_only
from gensim.utils import keep_vocab_item
Expand Down Expand Up @@ -1245,6 +1246,9 @@ def __str__(self):
return "%s(vocab=%s, size=%s, alpha=%s)" % (self.__class__.__name__, len(self.wv.index2word), self.vector_size, self.alpha)

def _minimize_model(self, save_syn1 = False, save_syn1neg = False, save_syn0_lockf = False):
warnings.warn("This method would be deprecated in the future. Keep just_word_vectors = model.wv to retain just the KeyedVectors instance for read-only querying of word vectors.")
if save_syn1 and save_syn1neg and save_syn0_lockf:
return
if hasattr(self, 'syn1') and not save_syn1:
del self.syn1
if hasattr(self, 'syn1neg') and not save_syn1neg:
Expand Down

0 comments on commit dd396e3

Please sign in to comment.