Spaces:
Running on Zero
Running on Zero
Update InferenceInterfaces/ControllableInterface.py
Browse files
InferenceInterfaces/ControllableInterface.py
CHANGED
|
@@ -32,6 +32,7 @@ class ControllableInterface:
|
|
| 32 |
reference_audio,
|
| 33 |
language,
|
| 34 |
accent,
|
|
|
|
| 35 |
voice_seed,
|
| 36 |
prosody_creativity,
|
| 37 |
duration_scaling_factor,
|
|
@@ -67,7 +68,7 @@ class ControllableInterface:
|
|
| 67 |
else:
|
| 68 |
self.model.set_utterance_embedding(reference_audio)
|
| 69 |
|
| 70 |
-
phones = self.model.text2phone.get_phone_string(prompt)
|
| 71 |
if len(phones) > 1800:
|
| 72 |
if language == "deu":
|
| 73 |
prompt = "Deine Eingabe war zu lang. Bitte versuche es entweder mit einem kürzeren Text oder teile ihn in mehrere Teile auf."
|
|
@@ -106,7 +107,7 @@ class ControllableInterface:
|
|
| 106 |
|
| 107 |
print(prompt + "\n\n")
|
| 108 |
wav, sr, fig = self.model(prompt,
|
| 109 |
-
input_is_phones=
|
| 110 |
duration_scaling_factor=duration_scaling_factor,
|
| 111 |
pitch_variance_scale=pitch_variance_scale,
|
| 112 |
energy_variance_scale=energy_variance_scale,
|
|
|
|
| 32 |
reference_audio,
|
| 33 |
language,
|
| 34 |
accent,
|
| 35 |
+
input_is_phones,
|
| 36 |
voice_seed,
|
| 37 |
prosody_creativity,
|
| 38 |
duration_scaling_factor,
|
|
|
|
| 68 |
else:
|
| 69 |
self.model.set_utterance_embedding(reference_audio)
|
| 70 |
|
| 71 |
+
phones = prompt if input_is_phones else self.model.text2phone.get_phone_string(prompt)
|
| 72 |
if len(phones) > 1800:
|
| 73 |
if language == "deu":
|
| 74 |
prompt = "Deine Eingabe war zu lang. Bitte versuche es entweder mit einem kürzeren Text oder teile ihn in mehrere Teile auf."
|
|
|
|
| 107 |
|
| 108 |
print(prompt + "\n\n")
|
| 109 |
wav, sr, fig = self.model(prompt,
|
| 110 |
+
input_is_phones=input_is_phones,
|
| 111 |
duration_scaling_factor=duration_scaling_factor,
|
| 112 |
pitch_variance_scale=pitch_variance_scale,
|
| 113 |
energy_variance_scale=energy_variance_scale,
|