From 25f711aa89c8ff03a52b9f66e016f3365e23d4f8 Mon Sep 17 00:00:00 2001 From: Marcel Ambo Ndowah Date: Mon, 9 Jun 2025 20:26:09 +0100 Subject: [PATCH] Drop as_target_processor from the _call_ and pad methods (#38642) Drop as_target_processor from _call_ and pad methods; reformat docstrings for readability --- .../models/wav2vec2/processing_wav2vec2.py | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/transformers/models/wav2vec2/processing_wav2vec2.py b/src/transformers/models/wav2vec2/processing_wav2vec2.py index 077f5617198..1df8ff89236 100644 --- a/src/transformers/models/wav2vec2/processing_wav2vec2.py +++ b/src/transformers/models/wav2vec2/processing_wav2vec2.py @@ -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: