Skip to content

Commit

Permalink
优化能自定义的下拉选择框在自定义输入后,重启webui可以追加自定义选项的功能
Browse files Browse the repository at this point in the history
  • Loading branch information
Ikaros-521 committed Apr 25, 2024
1 parent 1c86699 commit 09ea9a4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 4 additions & 2 deletions utils/audio.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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"):
Expand Down
6 changes: 6 additions & 0 deletions webui.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 09ea9a4

Please sign in to comment.