reverting

This commit is contained in:
Richard Liaw 2020-06-22 18:01:33 -07:00
parent 0df7d44978
commit 2fc73b42ae

View File

@ -1,10 +1,8 @@
from typing import Optional, Dict, List, Union, Sequence from typing import Optional, Dict, List, Union, Sequence
from timeit import default_timer as timer from timeit import default_timer as timer
import math
import srsly import srsly
from pydantic import BaseModel, FilePath from pydantic import BaseModel, FilePath
import plac import plac
import os
import tqdm import tqdm
from pathlib import Path from pathlib import Path
from wasabi import msg from wasabi import msg
@ -386,10 +384,6 @@ def train(
def create_train_batches(nlp, corpus, cfg): def create_train_batches(nlp, corpus, cfg):
epochs_todo = cfg.get("max_epochs", 0) epochs_todo = cfg.get("max_epochs", 0)
if world_rank is not None:
for i in range(world_rank):
# Increment random seed
random.random()
while True: while True:
train_examples = list( train_examples = list(
corpus.train_dataset( corpus.train_dataset(
@ -416,7 +410,7 @@ def create_train_batches(nlp, corpus, cfg):
yield first yield first
except StopIteration: except StopIteration:
raise ValueError(Errors.E986) raise ValueError(Errors.E986)
for i, batch in enumerate(batches): for batch in batches:
yield batch yield batch
epochs_todo -= 1 epochs_todo -= 1
# We intentionally compare exactly to 0 here, so that max_epochs < 1 # We intentionally compare exactly to 0 here, so that max_epochs < 1