Rajhuggingface4253 commited on
Commit
058ead7
·
verified ·
1 Parent(s): faa7036

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -150,7 +150,7 @@ class NeuTTSWrapper:
150
  # 3. Infer full text
151
  with torch.no_grad():
152
  audio = self.tts_model.infer(text, ref_s, reference_text)
153
- return audio.cpu().numpy()
154
 
155
  def stream_speech_blocking(self, text: str, ref_audio_path: str, reference_text: str, speed: float, audio_format: str) -> Generator[bytes, None, None]:
156
  """Sentence-by-Sentence Streaming (Blocking)."""
@@ -175,7 +175,7 @@ class NeuTTSWrapper:
175
  audio_chunk = self.tts_model.infer(sentence, ref_s, reference_text)
176
 
177
  # Convert and yield
178
- yield self._convert_to_streamable_format(audio_chunk.cpu().numpy(), audio_format)
179
 
180
  logger.info("Streaming synthesis complete.")
181
 
 
150
  # 3. Infer full text
151
  with torch.no_grad():
152
  audio = self.tts_model.infer(text, ref_s, reference_text)
153
+ return audio
154
 
155
  def stream_speech_blocking(self, text: str, ref_audio_path: str, reference_text: str, speed: float, audio_format: str) -> Generator[bytes, None, None]:
156
  """Sentence-by-Sentence Streaming (Blocking)."""
 
175
  audio_chunk = self.tts_model.infer(sentence, ref_s, reference_text)
176
 
177
  # Convert and yield
178
+ yield self._convert_to_streamable_format(audio_chunk, audio_format)
179
 
180
  logger.info("Streaming synthesis complete.")
181