Remove SpeechT5 deprecated argument (#28062)

This commit is contained in:
Yoach Lacombe 2023-12-15 12:15:06 +00:00 committed by GitHub
parent 6af3ce7757
commit c817c17dbe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 0 additions and 15 deletions

View File

@ -15,7 +15,6 @@
""" PyTorch SpeechT5 model.""" """ PyTorch SpeechT5 model."""
import math import math
import warnings
from typing import List, Optional, Tuple, Union from typing import List, Optional, Tuple, Union
import numpy as np import numpy as np
@ -2656,7 +2655,6 @@ class SpeechT5ForTextToSpeech(SpeechT5PreTrainedModel):
return_dict: Optional[bool] = None, return_dict: Optional[bool] = None,
speaker_embeddings: Optional[torch.FloatTensor] = None, speaker_embeddings: Optional[torch.FloatTensor] = None,
labels: Optional[torch.FloatTensor] = None, labels: Optional[torch.FloatTensor] = None,
stop_labels: Optional[torch.Tensor] = None,
) -> Union[Tuple, Seq2SeqSpectrogramOutput]: ) -> Union[Tuple, Seq2SeqSpectrogramOutput]:
r""" r"""
input_ids (`torch.LongTensor` of shape `(batch_size, sequence_length)`): input_ids (`torch.LongTensor` of shape `(batch_size, sequence_length)`):
@ -2704,12 +2702,6 @@ class SpeechT5ForTextToSpeech(SpeechT5PreTrainedModel):
""" """
return_dict = return_dict if return_dict is not None else self.config.use_return_dict return_dict = return_dict if return_dict is not None else self.config.use_return_dict
if stop_labels is not None:
warnings.warn(
"The argument `stop_labels` is deprecated and will be removed in version 4.30.0 of Transformers",
FutureWarning,
)
if labels is not None: if labels is not None:
if decoder_input_values is None: if decoder_input_values is None:
decoder_input_values = shift_spectrograms_right(labels, self.config.reduction_factor) decoder_input_values = shift_spectrograms_right(labels, self.config.reduction_factor)
@ -2981,7 +2973,6 @@ class SpeechT5ForSpeechToSpeech(SpeechT5PreTrainedModel):
return_dict: Optional[bool] = None, return_dict: Optional[bool] = None,
speaker_embeddings: Optional[torch.FloatTensor] = None, speaker_embeddings: Optional[torch.FloatTensor] = None,
labels: Optional[torch.FloatTensor] = None, labels: Optional[torch.FloatTensor] = None,
stop_labels: Optional[torch.Tensor] = None,
) -> Union[Tuple, Seq2SeqSpectrogramOutput]: ) -> Union[Tuple, Seq2SeqSpectrogramOutput]:
r""" r"""
input_values (`torch.FloatTensor` of shape `(batch_size, sequence_length)`): input_values (`torch.FloatTensor` of shape `(batch_size, sequence_length)`):
@ -3035,12 +3026,6 @@ class SpeechT5ForSpeechToSpeech(SpeechT5PreTrainedModel):
""" """
return_dict = return_dict if return_dict is not None else self.config.use_return_dict return_dict = return_dict if return_dict is not None else self.config.use_return_dict
if stop_labels is not None:
warnings.warn(
"The argument `stop_labels` is deprecated and will be removed in version 4.30.0 of Transformers",
FutureWarning,
)
if labels is not None: if labels is not None:
if decoder_input_values is None: if decoder_input_values is None:
decoder_input_values = shift_spectrograms_right(labels, self.config.reduction_factor) decoder_input_values = shift_spectrograms_right(labels, self.config.reduction_factor)