From ac35a77ebbc6d16ae75256bef578f2110b5c93de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E6=82=A6?= Date: Fri, 26 Jan 2024 15:40:14 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=BC=95=E5=AF=BC=E9=9F=B3?= =?UTF-8?q?=E9=A2=91=E8=AE=B0=E5=BF=86=E3=80=81=E5=BC=95=E5=AF=BC=E9=9F=B3?= =?UTF-8?q?=E9=A2=91=E6=96=87=E6=9C=AC=E8=AE=B0=E5=BF=86=E3=80=81=E8=AF=AD?= =?UTF-8?q?=E7=A7=8D=E8=AE=B0=E5=BF=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 增加引导音频记忆、引导音频文本记忆、语种记忆 --- GPT_SoVITS/inference_webui.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/GPT_SoVITS/inference_webui.py b/GPT_SoVITS/inference_webui.py index fdee8d9..9a9dd10 100644 --- a/GPT_SoVITS/inference_webui.py +++ b/GPT_SoVITS/inference_webui.py @@ -64,6 +64,23 @@ elif torch.backends.mps.is_available(): else: device = "cpu" +# 操作记忆功能 + +file_path = './audio_log.txt' + +upload_audio_path = None +upload_audio_text = "" +upload_audio_lanuage = "中文" + +if os.path.exists(file_path): + with open(file_path, 'r',encoding="utf-8") as file: + text_data = file.read() + text_data = text_data.split("|") + + upload_audio_path = text_data[0] + upload_audio_text = text_data[1] + upload_audio_lanuage = text_data[2] + tokenizer = AutoTokenizer.from_pretrained(bert_path) bert_model = AutoModelForMaskedLM.from_pretrained(bert_path) if is_half == True: @@ -183,6 +200,7 @@ dict_language={ def get_tts_wav(ref_wav_path, prompt_text, prompt_language, text, text_language): + with open("./audio_log.txt","w",encoding="utf-8")as f:f.write(f"{wav_path_log}|{prompt_text}|{prompt_language}") t0 = ttime() prompt_text = prompt_text.strip("\n") prompt_language, text = prompt_language, text.strip("\n")