提交 fe4e183f 编写于 作者: Y Yibing Liu

Fix data yield

上级 68e04f38
...@@ -196,10 +196,11 @@ class DataProcessor(object): ...@@ -196,10 +196,11 @@ class DataProcessor(object):
return_num_token=False) return_num_token=False)
if len(all_dev_batches) < dev_count: if len(all_dev_batches) < dev_count:
all_dev_batches.append(batch_data) all_dev_batches.append(batch_data)
else:
if len(all_dev_batches) == dev_count:
for batch in all_dev_batches: for batch in all_dev_batches:
yield batch yield batch
all_dev_batches = [batch_data] all_dev_batches = []
return wrapper return wrapper
......
...@@ -566,10 +566,11 @@ class DataProcessor(object): ...@@ -566,10 +566,11 @@ class DataProcessor(object):
return_num_token=False) return_num_token=False)
if len(all_dev_batches) < dev_count: if len(all_dev_batches) < dev_count:
all_dev_batches.append(batch_data) all_dev_batches.append(batch_data)
else:
if len(all_dev_batches) == dev_count:
for batch in all_dev_batches: for batch in all_dev_batches:
yield batch yield batch
all_dev_batches = [batch_data] all_dev_batches = []
return wrapper return wrapper
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册