From f8afaa0c1c7de7b57de7af8efe29fc15b8e74872 Mon Sep 17 00:00:00 2001 From: Matthew Honnibal Date: Thu, 15 Nov 2018 22:46:53 +0000 Subject: [PATCH] Fix pretrain --- spacy/cli/pretrain.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spacy/cli/pretrain.py b/spacy/cli/pretrain.py index fea8db8fd..cb5a524f3 100644 --- a/spacy/cli/pretrain.py +++ b/spacy/cli/pretrain.py @@ -188,8 +188,8 @@ def pretrain(texts_loc, vectors_model, output_dir, width=128, depth=4, progress = tracker.update(epoch, loss, docs) if progress: print(*progress) - if texts_loc == '-' and progress.words_per_epoch[epoch] >= 10**7: - break + if texts_loc == '-' and tracker.words_per_epoch[epoch] >= 10**7: + break with model.use_params(optimizer.averages): with (output_dir / ('model%d.bin' % epoch)).open('wb') as file_: file_.write(tok2vec.to_bytes())