padding=True in the data_collator does the padding to the maximum length of the batch, so that’s the way to go 
But if you want to do the tokenization in map instead of in the data collator you can, but you must add an extra padding step in the data_collator to make sure all the examples in each batch have the same length