From a44d4a8b915ff824e72969689b3b6e3286e75f22 Mon Sep 17 00:00:00 2001 From: Bobby Date: Tue, 19 Mar 2024 09:36:29 +0000 Subject: [PATCH] =?UTF-8?q?=E5=9C=A8=E6=8E=A8=E7=90=86=E6=8C=89=E9=92=AE?= =?UTF-8?q?=E4=B8=8B=E6=96=B9=E5=A2=9E=E5=8A=A0=E6=8E=A8=E7=90=86=E4=BD=BF?= =?UTF-8?q?=E7=94=A8=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- GPT_SoVITS/TTS_infer_pack/TTS.py | 10 +++++++--- GPT_SoVITS/inference_webui.py | 4 +++- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/GPT_SoVITS/TTS_infer_pack/TTS.py b/GPT_SoVITS/TTS_infer_pack/TTS.py index 566e998..2aede2b 100644 --- a/GPT_SoVITS/TTS_infer_pack/TTS.py +++ b/GPT_SoVITS/TTS_infer_pack/TTS.py @@ -615,7 +615,7 @@ class TTS: fragment_interval = inputs.get("fragment_interval", 0.3) seed = inputs.get("seed", -1) seed = -1 if seed in ["", None] else seed - set_seed(seed) + actual_seed = set_seed(seed) if return_fragment: # split_bucket = False @@ -824,13 +824,17 @@ class TTS: if not return_fragment: print("%.3f\t%.3f\t%.3f\t%.3f" % (t1 - t0, t2 - t1, t_34, t_45)) - yield self.audio_postprocess(audio, + yield [ + self.audio_postprocess(audio, self.configs.sampling_rate, batch_index_list, speed_factor, split_bucket, fragment_interval - ) + ), + f"text: {text} text_lang: {text_lang} prompt_text: {prompt_text} prompt_lang: {prompt_lang} top_k: {top_k} top_p: {top_p} temperature: {temperature} batch_size: {batch_size} batch_threshold: {batch_threshold} split_bucket: {split_bucket} return_fragment: {return_fragment} speed_factor: {speed_factor} fragment_interval: {fragment_interval} seed: {actual_seed}" + ] + except Exception as e: traceback.print_exc() # 必须返回一个空音频, 否则会导致显存不释放。 diff --git a/GPT_SoVITS/inference_webui.py b/GPT_SoVITS/inference_webui.py index 505b665..3355e91 100644 --- a/GPT_SoVITS/inference_webui.py +++ b/GPT_SoVITS/inference_webui.py @@ -211,6 +211,8 @@ with gr.Blocks(title="GPT-SoVITS WebUI") as app: with gr.Row(): inference_button = gr.Button(i18n("合成语音"), variant="primary") stop_infer = gr.Button(i18n("终止合成"), variant="primary") + with gr.Row(): + inference_details = gr.Markdown() inference_button.click( @@ -224,7 +226,7 @@ with gr.Blocks(title="GPT-SoVITS WebUI") as app: split_bucket,fragment_interval, seed ], - [output], + [output, inference_details], ) stop_infer.click(tts_pipline.stop, [], [])