Skip to content

Commit

Permalink
update inference_pool
Browse files Browse the repository at this point in the history
  • Loading branch information
BeautyyuYanli committed Jun 13, 2024
1 parent 1295c6a commit 0f4be9b
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/gpt_sovits/infer/inference_pool.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,11 @@ def get_tts_wav_stream(
for task in tasks
]
for future in futures:
yield future.result()
try:
yield future.result()
except Exception as e:
self.pool.shutdown(wait=False)
raise e

def get_tts_wav(
self,
Expand All @@ -149,3 +153,6 @@ def get_tts_wav(
return audio_list[0][0], np.concatenate(
[data for _, data in audio_list], axis=0
)

def __del__(self):
self.pool.shutdown(wait=False)

0 comments on commit 0f4be9b

Please sign in to comment.