Skip to content

利用 AI 大模型和自动化工作流,根据主题或关键词一键生成高清短视频。Generate HD short videos from a topic or keyword with an automated AI workflow.

Fix the issue where model_name is always empty when using OneAPI as the LLM source.

yyhhyyyyyy7ff8467f9dd6
diff --git a/webui/Main.py b/webui/Main.py
index 1cec8429..ea0e89e3 100644
--- a/webui/Main.py
+++ b/webui/Main.py
@@ -246,7 +246,17 @@ if not config.app.get("hide_config", False):
- **Base Url**: 固定为 https://api.moonshot.cn/v1
- **Model Name**: 比如 moonshot-v1-8k,[点击查看模型列表](https://platform.moonshot.cn/docs/intro#%E6%A8%A1%E5%9E%8B%E5%88%97%E8%A1%A8)
"""
-
+ if llm_provider == 'oneapi':
+ if not llm_model_name:
+ llm_model_name = "claude-3-5-sonnet-20240620" # 默认模型,可以根据需要调整
+ with llm_helper:
+ tips = """
+ ##### OneAPI 配置说明
+ - **API Key**: 填写您的 OneAPI 密钥
+ - **Base Url**: 填写 OneAPI 的基础 URL
+ - **Model Name**: 填写您要使用的模型名称,例如 claude-3-5-sonnet-20240620
+ """
+
if llm_provider == 'qwen':
if not llm_model_name:
llm_model_name = "qwen-max"
@@ -323,7 +333,11 @@ if not config.app.get("hide_config", False):
st_llm_base_url = st.text_input(tr("Base Url"), value=llm_base_url)
st_llm_model_name = ""
if llm_provider != 'ernie':
- st.text_input(tr("Model Name"), value=llm_model_name)
+ st_llm_model_name = st.text_input(tr("Model Name"), value=llm_model_name, key=f"{llm_provider}_model_name_input")
+ if st_llm_model_name:
+ config.app[f"{llm_provider}_model_name"] = st_llm_model_name
+ else:
+ st_llm_model_name = None
if st_llm_api_key:
config.app[f"{llm_provider}_api_key"] = st_llm_api_key