Skip to content

Commit

Permalink
fix unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
mpenkov committed Jan 26, 2019
1 parent 677679c commit 29c5210
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions gensim/test/test_fasttext.py
Original file line number Diff line number Diff line change
Expand Up @@ -695,7 +695,10 @@ def test_online_learning_after_save_fromfile(self):
epochs=model_neg.epochs)
self.assertEqual(len(model_neg.wv.vocab), 14)

def online_sanity(self, model):
def online_sanity(self, model, epochs=None):
if epochs is None:
epochs = model.epochs

terro, others = [], []
for l in list_corpus:
if 'terrorism' in l:
Expand Down Expand Up @@ -730,9 +733,9 @@ def test_sg_neg_online(self):
@unittest.skipIf(IS_WIN32, "avoid memory error with Appveyor x32")
def test_cbow_hs_online(self):
model = FT_gensim(
sg=0, cbow_mean=1, alpha=0.05, window=2, hs=1, negative=0, min_count=3, iter=1, seed=42, workers=1
sg=0, cbow_mean=1, alpha=0.05, window=2, hs=1, negative=0, min_count=3, seed=42, workers=1
)
self.online_sanity(model)
self.online_sanity(model, epochs=1)

@unittest.skipIf(IS_WIN32, "avoid memory error with Appveyor x32")
def test_cbow_neg_online(self):
Expand Down

0 comments on commit 29c5210

Please sign in to comment.