@@ -263,7 +263,7 @@ def __call__(
263263 self ,
264264 raw_speech : np .ndarray | list [float ] | list [np .ndarray ] | list [list [float ]],
265265 truncation : str | None = None ,
266- padding : str | None = None ,
266+ padding : bool | str | None = None ,
267267 max_length : int | None = None ,
268268 sampling_rate : int | None = None ,
269269 return_tensors : str | TensorType | None = None ,
@@ -284,8 +284,9 @@ def __call__(
284284 If `config.fusion` is set to True, shorter audios also need to return 4 mels, which will just be a
285285 copy of the original mel obtained from the padded audio.
286286 - `rand_trunc` will select a random crop of the mel spectrogram.
287- padding (`str`, *optional*):
288- Padding pattern for shorter audio inputs. Three patterns were originally implemented:
287+ padding (`bool`, `str`, *optional*):
288+ Padding pattern for shorter audio inputs. If `True`, defaults to `self.padding`.
289+ Available patterns:
289290 - `repeatpad`: the audio is repeated, and then padded to fit the `max_length`.
290291 - `repeat`: the audio is repeated and then cut to fit the `max_length`
291292 - `pad`: the audio is padded.
@@ -299,7 +300,8 @@ def __call__(
299300 pipeline.
300301 """
301302 truncation = truncation if truncation is not None else self .truncation
302- padding = padding if padding else self .padding
303+ if padding is True or padding is None :
304+ padding = self .padding
303305
304306 if sampling_rate is not None :
305307 if sampling_rate != self .sampling_rate :
0 commit comments