ZhouChuYue commited on
Commit
d540654
·
1 Parent(s): 787a7ad

feat: use GLM-4-flash model instead of GPT

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -28,8 +28,8 @@ from run_synthesis import (
28
 
29
  # API 配置从环境变量读取(通过 HF Secrets 设置)
30
  API_KEY = os.getenv("OPENAI_API_KEY")
31
- BASE_URL = os.getenv("OPENAI_BASE_URL", "https://api.openai.com/v1")
32
- DEFAULT_MODEL = "gpt-4o"
33
 
34
 
35
  async def call_api(prompt: str, model: str = DEFAULT_MODEL, temperature: float = 0.7) -> str:
@@ -190,8 +190,8 @@ with gr.Blocks(title="UltraData-Math L3 Generator", css=custom_css) as demo:
190
 
191
  with gr.Row():
192
  model_select = gr.Dropdown(
193
- choices=["gpt-4o", "gpt-4o-mini", "gpt-4-turbo", "gpt-3.5-turbo"],
194
- value="gpt-4o",
195
  label="Model",
196
  scale=1,
197
  )
 
28
 
29
  # API 配置从环境变量读取(通过 HF Secrets 设置)
30
  API_KEY = os.getenv("OPENAI_API_KEY")
31
+ BASE_URL = os.getenv("OPENAI_BASE_URL", "https://open.bigmodel.cn/api/paas/v4")
32
+ DEFAULT_MODEL = "glm-4-flash"
33
 
34
 
35
  async def call_api(prompt: str, model: str = DEFAULT_MODEL, temperature: float = 0.7) -> str:
 
190
 
191
  with gr.Row():
192
  model_select = gr.Dropdown(
193
+ choices=["glm-4-flash", "glm-4-plus", "glm-4-air", "glm-4-long"],
194
+ value="glm-4-flash",
195
  label="Model",
196
  scale=1,
197
  )