Warn for unexpected argument combinations (#13509)
* Warn for unexpected argument combinations * Updated the waning message for pad_to_max_length
This commit is contained in:
@@ -2222,6 +2222,11 @@ class PreTrainedTokenizerBase(SpecialTokensMixin, PushToHubMixin):
|
||||
padding_strategy = PaddingStrategy.MAX_LENGTH
|
||||
elif padding is not False:
|
||||
if padding is True:
|
||||
if verbose:
|
||||
if max_length is not None:
|
||||
warnings.warn("`max_length` is ignored when `padding`=`True`.")
|
||||
if old_pad_to_max_length is not False:
|
||||
warnings.warn("Though `pad_to_max_length` = `True`, it is ignored because `padding`=`True`.")
|
||||
padding_strategy = PaddingStrategy.LONGEST # Default to pad to the longest sequence in the batch
|
||||
elif not isinstance(padding, PaddingStrategy):
|
||||
padding_strategy = PaddingStrategy(padding)
|
||||
|
||||
Reference in New Issue
Block a user