From f5cda5d4d50fa5bc11bb5277345137faa4a34b05 Mon Sep 17 00:00:00 2001 From: XTer Date: Sun, 17 Mar 2024 15:37:57 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E4=BA=86app?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Inference | 2 +- app.py | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Inference b/Inference index 1b59faa0..6e09974b 160000 --- a/Inference +++ b/Inference @@ -1 +1 @@ -Subproject commit 1b59faa01237c81bde6c2dfa4a0c0491bc50dda5 +Subproject commit 6e09974b7fd2827f0f1dd30301653f4359950a86 diff --git a/app.py b/app.py index c637ef24..4f9ce5dc 100644 --- a/app.py +++ b/app.py @@ -24,7 +24,7 @@ if os.path.exists(config_path): locale_language = str(_config.get("locale", "auto")) locale_language = None if locale_language.lower() == "auto" else locale_language tts_port = _config.get("tts_port", 5000) - max_text_length = _config.get("max_text_length", 70) + max_text_length = _config.get("max_text_length", -1) default_batch_size = _config.get("batch_size", 10) default_word_count = _config.get("max_word_count", 80) is_share = _config.get("is_share", "false").lower() == "true" @@ -108,7 +108,7 @@ def send_request( params = { - "text": text, + "text": text.replace("…","。").replace("。\n","\n").replace("\n", "。\n"), "text_language": text_language, "top_k": top_k, @@ -279,8 +279,9 @@ except: with gr.Blocks() as app: gr.Markdown(information) with gr.Row(): + max_text_length_tip = "" if max_text_length == -1 else f"( "+i18n("最大允许长度")+ f" : {max_text_length} ) " text = gr.Textbox( - value=default_text, label=i18n("输入文本")+"( "+ i18n("最大允许长度") + f": {max_text_length} )", interactive=True, lines=8 + value=default_text, label=i18n("输入文本")+max_text_length_tip, interactive=True, lines=8 ) text.blur(lambda x: gr.update(value=cut_sentence_multilang(x,max_length=max_text_length)[0]), [text], [text]) with gr.Row():