File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
chebai/preprocessing/datasets Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -285,18 +285,19 @@ def _tokenize_batched(self, data):
285
285
b
286
286
for b in batch
287
287
if b ["features" ] is not None
288
- and (self .n_token_limit is None
289
- or len (b ["features" ]) <= self .n_token_limit )
290
288
]
289
+ if self .n_token_limit is not None :
290
+ batch = [b for b in batch if len (b ["features" ]) <= self .n_token_limit ]
291
291
yield batch
292
292
batch = []
293
293
print ("Saving final batch" )
294
294
batch = [
295
295
b
296
296
for b in batch
297
297
if b ["features" ] is not None
298
- and (self .n_token_limit is None or len (b ["features" ]) <= self .n_token_limit )
299
298
]
299
+ if self .n_token_limit is not None :
300
+ batch = [b for b in batch if len (b ["features" ]) <= self .n_token_limit ]
300
301
yield batch
301
302
302
303
def setup_processed (self ):
You can’t perform that action at this time.
0 commit comments