Skip to content

Commit

Permalink
🐛 manual pick 906f2f7
Browse files Browse the repository at this point in the history
  • Loading branch information
zhzLuke96 committed Jul 12, 2024
1 parent f604f5c commit 878fa52
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions modules/core/models/zoo/ChatTTSInfer.py
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,7 @@ def _generate_audio(
prompt2=prompt2,
prefix=prefix,
stream_chunk_size=stream_chunk_size,
ensure_non_empty=False,
)
return self.infer(
text=text,
Expand All @@ -301,7 +302,7 @@ def generate_audio(
use_decoder=True,
) -> list[np.ndarray]:
with disable_tqdm(enabled=config.runtime_env_vars.off_tqdm):
return self._generate_audio(
data = self._generate_audio(
text=text,
spk_emb=spk_emb,
top_P=top_P,
Expand All @@ -315,6 +316,7 @@ def generate_audio(
use_decoder=use_decoder,
stream=False,
)
return [i for i in data if i is not None]

def generate_audio_stream(
self,
Expand Down Expand Up @@ -350,7 +352,8 @@ def generate_audio_stream(
def _generator():
with disable_tqdm(enabled=config.runtime_env_vars.off_tqdm):
for audio in gen:
yield audio
if audio is not None:
yield audio

return _generator()

Expand Down

0 comments on commit 878fa52

Please sign in to comment.