Skip to content

Commit 0d1a580

Browse files
committed
Merge branch 'master' into dev0.8.0
2 parents 8a32931 + 213bef3 commit 0d1a580

File tree

4 files changed

+7
-1
lines changed

4 files changed

+7
-1
lines changed

fastNLP/core/controllers/loops/evaluate_batch_loop.py

+2
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ class EvaluateBatchLoop(Loop):
1818
def __init__(self, batch_step_fn:Optional[Callable]=None):
1919
if batch_step_fn is not None:
2020
self.batch_step_fn = batch_step_fn
21+
else:
22+
self.batch_step_fn = EvaluateBatchLoop.batch_step_fn
2123

2224
def run(self, evaluator, dataloader) -> Dict:
2325
r"""

fastNLP/core/controllers/loops/train_batch_loop.py

+2
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ class TrainBatchLoop(Loop):
2020
def __init__(self, batch_step_fn: Optional[Callable] = None):
2121
if batch_step_fn is not None:
2222
self.batch_step_fn = batch_step_fn
23+
else:
24+
self.batch_step_fn = TrainBatchLoop.batch_step_fn
2325

2426
def run(self, trainer, dataloader):
2527
r"""

fastNLP/core/dataloaders/utils.py

+2
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,8 @@ def __init__(self, dataloader, overfit_batches: int, batches=None):
131131
for idx, batch in enumerate(dataloader):
132132
if idx < self.overfit_batches or self.overfit_batches <= -1:
133133
self.batches.append(batch)
134+
else:
135+
break
134136
else:
135137
assert isinstance(batches, list)
136138
self.batches = batches

setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
setup(
1818
name='FastNLP',
19-
version='1.0.0beta',
19+
version='1.0.0',
2020
url='https://gitee.com/fastnlp/fastNLP',
2121
description='fastNLP: Deep Learning Toolkit for NLP, developed by Fudan FastNLP Team',
2222
long_description=readme,

0 commit comments

Comments
 (0)