Skip to content

Commit

Permalink
patch
Browse files Browse the repository at this point in the history
  • Loading branch information
francoishernandez committed Jan 29, 2025
1 parent f2d4931 commit d3250a7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions eole/inputters/text_corpus.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ def __str__(self):
class ParallelCorpus(object):
"""A parallel corpus file pair that can be loaded to iterate."""

def __init__(self, name, src, tgt, sco=None, align=None):
def __init__(self, name, src, tgt, sco=None, align=None, is_train=False):
"""Initialize src & tgt side file path."""
self.id = name
self.src = src
Expand Down Expand Up @@ -314,7 +314,7 @@ class ParallelCorpusIterator(object):
offset (int): iterate corpus with this line offset.
"""

def __init__(self, corpus, transform, skip_empty_level="warning", stride=1, offset=0):
def __init__(self, corpus, transform, skip_empty_level="warning", stride=1, offset=0, is_train=False):
self.cid = corpus.id
self.corpus = corpus
self.transform = transform
Expand Down Expand Up @@ -425,7 +425,7 @@ def build_corpora_iters(corpora, transforms, corpora_info, skip_empty_level="war
skip_empty_level=skip_empty_level,
stride=stride,
offset=offset,
is_train=corpus.is_train,
is_train=getattr(corpus, "is_train", None),
)
corpora_iters[c_id] = corpus_iter
return corpora_iters
Expand Down

0 comments on commit d3250a7

Please sign in to comment.