mirror of
https://github.com/explosion/spaCy.git
synced 2024-12-26 01:46:28 +03:00
Fix pretrain
This commit is contained in:
parent
6af6950e46
commit
f8afaa0c1c
|
@ -188,8 +188,8 @@ def pretrain(texts_loc, vectors_model, output_dir, width=128, depth=4,
|
||||||
progress = tracker.update(epoch, loss, docs)
|
progress = tracker.update(epoch, loss, docs)
|
||||||
if progress:
|
if progress:
|
||||||
print(*progress)
|
print(*progress)
|
||||||
if texts_loc == '-' and progress.words_per_epoch[epoch] >= 10**7:
|
if texts_loc == '-' and tracker.words_per_epoch[epoch] >= 10**7:
|
||||||
break
|
break
|
||||||
with model.use_params(optimizer.averages):
|
with model.use_params(optimizer.averages):
|
||||||
with (output_dir / ('model%d.bin' % epoch)).open('wb') as file_:
|
with (output_dir / ('model%d.bin' % epoch)).open('wb') as file_:
|
||||||
file_.write(tok2vec.to_bytes())
|
file_.write(tok2vec.to_bytes())
|
||||||
|
|
Loading…
Reference in New Issue
Block a user