From 09ea9a433cff77b800a937f18cf27f15ddce3505 Mon Sep 17 00:00:00 2001 From: ikaros <327209194@qq.com> Date: Fri, 26 Apr 2024 00:28:56 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E8=83=BD=E8=87=AA=E5=AE=9A?= =?UTF-8?q?=E4=B9=89=E7=9A=84=E4=B8=8B=E6=8B=89=E9=80=89=E6=8B=A9=E6=A1=86?= =?UTF-8?q?=E5=9C=A8=E8=87=AA=E5=AE=9A=E4=B9=89=E8=BE=93=E5=85=A5=E5=90=8E?= =?UTF-8?q?=EF=BC=8C=E9=87=8D=E5=90=AFwebui=E5=8F=AF=E4=BB=A5=E8=BF=BD?= =?UTF-8?q?=E5=8A=A0=E8=87=AA=E5=AE=9A=E4=B9=89=E9=80=89=E9=A1=B9=E7=9A=84?= =?UTF-8?q?=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- utils/audio.py | 6 ++++-- webui.py | 6 ++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/utils/audio.py b/utils/audio.py index e9069f7a..b221d893 100644 --- a/utils/audio.py +++ b/utils/audio.py @@ -1005,7 +1005,7 @@ async def voice_change_and_put_to_queue(message, voice_tmp_path): voice_tmp_path = None if voice_tmp_path is None: - logging.error(f"{message['tts_type']}合成失败,请排查配置、网络等问题") + logging.error(f"{message['tts_type']}合成失败,请排查服务端是否启动、是否正常,配置、网络等问题") self.abnormal_alarm_handle("tts") return False @@ -1902,7 +1902,9 @@ def abnormal_alarm_handle(self, type): if not self.config.get("abnormal_alarm", type, "enable"): return True - + + logging.debug(f"abnormal_alarm_handle type={type}, error_count={Audio.abnormal_alarm_data[type]['error_count']}") + if self.config.get("abnormal_alarm", type, "type") == "local_audio": # 是否错误数大于 自动重启错误数 if Audio.abnormal_alarm_data[type]["error_count"] >= self.config.get("abnormal_alarm", type, "auto_restart_error_num"): diff --git a/webui.py b/webui.py index 97e5537a..fbb1204a 100644 --- a/webui.py +++ b/webui.py @@ -3913,6 +3913,9 @@ def anythingllm_get_workspaces_list(): "g4f.Provider.GptTalkRu", "g4f.Provider.Koala", ] + # 将用户配置的值插入list(如果不存在) + if config.get("gpt4free", "provider") not in providers: + providers.append(config.get("gpt4free", "provider")) data_json = {} for line in providers: data_json[line] = line @@ -3932,6 +3935,9 @@ def anythingllm_get_workspaces_list(): "gpt-4", "gpt-4-turbo", ] + # 将用户配置的值插入list(如果不存在) + if config.get("gpt4free", "model") not in gpt4free_models: + gpt4free_models.append(config.get("gpt4free", "model")) data_json = {} for line in gpt4free_models: data_json[line] = line