Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
|
@@ -145,12 +145,11 @@ class NeuTTSWrapper:
|
|
| 145 |
"""Blocking synthesis for standard endpoint."""
|
| 146 |
|
| 147 |
|
| 148 |
-
|
| 149 |
-
ref_s = self.tts_model.encode_reference(reference_audio)
|
| 150 |
|
| 151 |
# 3. Infer full text
|
| 152 |
with torch.no_grad():
|
| 153 |
-
audio = self.tts_model.infer(text, ref_s
|
| 154 |
return audio.cpu().numpy()
|
| 155 |
|
| 156 |
def stream_speech_blocking(self, text: str, ref_audio_path: str, speed: float, audio_format: str) -> Generator[bytes, None, None]:
|
|
@@ -173,7 +172,7 @@ class NeuTTSWrapper:
|
|
| 173 |
|
| 174 |
# Infer sentence
|
| 175 |
with torch.no_grad():
|
| 176 |
-
audio_chunk = self.tts_model.infer(sentence, ref_s
|
| 177 |
|
| 178 |
# Convert and yield
|
| 179 |
yield self._convert_to_streamable_format(audio_chunk.cpu().numpy(), audio_format)
|
|
|
|
| 145 |
"""Blocking synthesis for standard endpoint."""
|
| 146 |
|
| 147 |
|
| 148 |
+
ref_s = self.tts_model.encode_reference(ref_audio_path)
|
|
|
|
| 149 |
|
| 150 |
# 3. Infer full text
|
| 151 |
with torch.no_grad():
|
| 152 |
+
audio = self.tts_model.infer(text, ref_s)
|
| 153 |
return audio.cpu().numpy()
|
| 154 |
|
| 155 |
def stream_speech_blocking(self, text: str, ref_audio_path: str, speed: float, audio_format: str) -> Generator[bytes, None, None]:
|
|
|
|
| 172 |
|
| 173 |
# Infer sentence
|
| 174 |
with torch.no_grad():
|
| 175 |
+
audio_chunk = self.tts_model.infer(sentence, ref_s)
|
| 176 |
|
| 177 |
# Convert and yield
|
| 178 |
yield self._convert_to_streamable_format(audio_chunk.cpu().numpy(), audio_format)
|