Drop as_target_processor from the _call_ and pad methods (#38642)

Drop as_target_processor from _call_ and pad methods; reformat docstrings for readability
This commit is contained in:
Marcel Ambo Ndowah 2025-06-09 20:26:09 +01:00 committed by GitHub
parent 837ddac1ec
commit 25f711aa89
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -81,10 +81,8 @@ class Wav2Vec2Processor(ProcessorMixin):
**kwargs: Unpack[Wav2Vec2ProcessorKwargs],
):
"""
When used in normal mode, this method forwards all its arguments to Wav2Vec2FeatureExtractor's
[`~Wav2Vec2FeatureExtractor.__call__`] and returns its output. If used in the context
[`~Wav2Vec2Processor.as_target_processor`] this method forwards all its arguments to PreTrainedTokenizer's
[`~PreTrainedTokenizer.__call__`]. Please refer to the docstring of the above two methods for more information.
This method forwards all its arguments to Wav2Vec2FeatureExtractor's
[`~Wav2Vec2FeatureExtractor.__call__`] and returns its output.
"""
if "raw_speech" in kwargs:
@ -123,10 +121,8 @@ class Wav2Vec2Processor(ProcessorMixin):
def pad(self, *args, **kwargs):
"""
When used in normal mode, this method forwards all its arguments to Wav2Vec2FeatureExtractor's
[`~Wav2Vec2FeatureExtractor.pad`] and returns its output. If used in the context
[`~Wav2Vec2Processor.as_target_processor`] this method forwards all its arguments to PreTrainedTokenizer's
[`~PreTrainedTokenizer.pad`]. Please refer to the docstring of the above two methods for more information.
This method forwards all its arguments to Wav2Vec2FeatureExtractor's
[`~Wav2Vec2FeatureExtractor.pad`] and returns its output.
"""
# For backward compatibility
if self._in_target_context_manager: