Add Padding Strategy to DataCollatorForLanguageModeling

#40032

Issue Details

27 days ago
No assignee
Feature request
rjgleatonrjgleaton
opened 27 days ago
Author

Feature request

Add the ability to specify a padding strategy when using DataCollatorForLanguageModeling

Motivation

This is a minor QOL enhancement that makes the collator more consistent with others in the library. The main use case would probably be padding to max length to make memory usage more stable during training.

Your contribution

I'll submit a PR in just a bit to add this :)