Remove SpeechT5 deprecated argument (#28062)
This commit is contained in:
parent
6af3ce7757
commit
c817c17dbe
|
@ -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)
|
||||||
|
|
Loading…
Reference in New Issue