File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -222,6 +222,10 @@ def reader(data_path, max_seq_len=512):
222
222
if len (content ) <= max_content_len :
223
223
yield json_line
224
224
else :
225
+ if result ['end' ] - result ['start' ] > max_content_len :
226
+ logger .warn (
227
+ "result['end '] - result ['start'] exceeds max_content_len, which will result in no valid instance being returned"
228
+ )
225
229
result_list = json_line ['result_list' ]
226
230
json_lines = []
227
231
accumulate = 0
@@ -230,7 +234,8 @@ def reader(data_path, max_seq_len=512):
230
234
231
235
for result in result_list :
232
236
if result ['start' ] + 1 <= max_content_len < result [
233
- 'end' ]:
237
+ 'end' ] and result ['end' ] - result [
238
+ 'start' ] <= max_content_len :
234
239
max_content_len = result ['start' ]
235
240
break
236
241
You can’t perform that action at this time.
0 commit comments