Skip to content

Commit 92a63ee

Browse files
guillaumeklnvince62s
authored andcommitted
Do not raise an error for missing validation data (#1467)
1 parent 289c413 commit 92a63ee

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

onmt/inputters/inputter.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -771,10 +771,11 @@ def build_dataset_iter(corpus_type, fields, opt, is_train=True, multi=False):
771771
"""
772772
dataset_paths = list(sorted(
773773
glob.glob(opt.data + '.' + corpus_type + '.[0-9]*.pt')))
774-
assert dataset_paths != [], \
775-
"Check data %s - %s" % (opt.data, corpus_type)
776774
if not dataset_paths:
777-
return None
775+
if is_train:
776+
raise ValueError('Training data %s not found' % opt.data)
777+
else:
778+
return None
778779
if multi:
779780
batch_size = 1
780781
batch_fn = None

0 commit comments

Comments
 (0)