Youssef Benhachem commited on
Commit
d22e0a9
1 Parent(s): 308d0e6
Files changed (1) hide show
  1. KHATT.py +1 -5
KHATT.py CHANGED
@@ -98,7 +98,6 @@ class KHATT(datasets.GeneratorBasedBuilder):
98
  if split != "test":
99
  # image filepath format: <FormNo>_<ParagraphNo>_<LineNo>.TIF
100
  #import ipdb; ipdb.set_trace()
101
- img_source = path.split('/')[0]
102
  img_file = file
103
  else:
104
  text = ""
@@ -111,10 +110,7 @@ class KHATT(datasets.GeneratorBasedBuilder):
111
 
112
  ex = {"image": {"path": path, "bytes": img_file.read()}, "text": text}
113
 
114
- if split == img_source:
115
- yield idx, ex
116
- else:
117
- continue
118
 
119
  idx += 1
120
 
 
98
  if split != "test":
99
  # image filepath format: <FormNo>_<ParagraphNo>_<LineNo>.TIF
100
  #import ipdb; ipdb.set_trace()
 
101
  img_file = file
102
  else:
103
  text = ""
 
110
 
111
  ex = {"image": {"path": path, "bytes": img_file.read()}, "text": text}
112
 
113
+ yield idx, ex
 
 
 
114
 
115
  idx += 1
116