.map - function overloads my Cache

Yup the data collator can take a batch as input and apply the padding :slight_smile:

I don’t have a code example but you can check the DataCollatorWithPadding that does tokenization + padding for example: Data Collator

1 Like