Update modeling_vits.py
Browse files- modeling_vits.py +1 -1
modeling_vits.py
CHANGED
|
@@ -104,7 +104,7 @@ class VitsModel(VitsPreTrainedModel):
|
|
| 104 |
else:
|
| 105 |
input_padding_mask = torch.ones_like(input_ids).unsqueeze(-1).to(mask_dtype)
|
| 106 |
|
| 107 |
-
if self.config.num_speakers > 1 and speaker_id is not None:
|
| 108 |
if not 0 <= speaker_id < self.config.num_speakers:
|
| 109 |
raise ValueError(f"Set `speaker_id` in the range 0-{self.config.num_speakers - 1}. or Set `emotion_id` in the range 0-{self.config.num_emotions - 1}.")
|
| 110 |
if isinstance(speaker_id, int) and isinstance(emotion_id, int):
|
|
|
|
| 104 |
else:
|
| 105 |
input_padding_mask = torch.ones_like(input_ids).unsqueeze(-1).to(mask_dtype)
|
| 106 |
|
| 107 |
+
if self.config.num_speakers > 1 and speaker_id is not None and self.config.num_emotions > 1 and emotion_id is not None:
|
| 108 |
if not 0 <= speaker_id < self.config.num_speakers:
|
| 109 |
raise ValueError(f"Set `speaker_id` in the range 0-{self.config.num_speakers - 1}. or Set `emotion_id` in the range 0-{self.config.num_emotions - 1}.")
|
| 110 |
if isinstance(speaker_id, int) and isinstance(emotion_id, int):
|