ZhouChuYue
commited on
Commit
·
d540654
1
Parent(s):
787a7ad
feat: use GLM-4-flash model instead of GPT
Browse files
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://
|
| 32 |
-
DEFAULT_MODEL = "
|
| 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=["
|
| 194 |
-
value="
|
| 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 |
)
|