Spaces:
Running on Zero
Running on Zero
zhang commited on
Update app.py
Browse files
app.py
CHANGED
|
@@ -4,9 +4,9 @@ import spaces
|
|
| 4 |
# 定义推理逻辑
|
| 5 |
@spaces.GPU
|
| 6 |
def chat_fn(message, history):
|
| 7 |
-
#
|
| 8 |
-
# 这是一种更稳定的 API 调用流式写法
|
| 9 |
model = gr.load("models/deepseek-ai/DeepSeek-R1-Distill-Qwen-32B")
|
|
|
|
| 10 |
response = model(message)
|
| 11 |
return response
|
| 12 |
|
|
@@ -15,10 +15,9 @@ with gr.Blocks(fill_height=True) as demo:
|
|
| 15 |
gr.Markdown("# 🚀 OpenIPOS Global 算力节点")
|
| 16 |
gr.Markdown("### DeepSeek-R1 32B 满血版演示站")
|
| 17 |
|
| 18 |
-
# 核心聊天组件
|
| 19 |
gr.ChatInterface(
|
| 20 |
chat_fn,
|
| 21 |
-
type="messages",
|
| 22 |
description="本节点由 OpenIPOS 提供法律级高逻辑推理算力支持。",
|
| 23 |
)
|
| 24 |
|
|
|
|
| 4 |
# 定义推理逻辑
|
| 5 |
@spaces.GPU
|
| 6 |
def chat_fn(message, history):
|
| 7 |
+
# 使用 gr.load 远程调用模型,这是在 Space 中最稳定的方案
|
|
|
|
| 8 |
model = gr.load("models/deepseek-ai/DeepSeek-R1-Distill-Qwen-32B")
|
| 9 |
+
# 获取返回结果
|
| 10 |
response = model(message)
|
| 11 |
return response
|
| 12 |
|
|
|
|
| 15 |
gr.Markdown("# 🚀 OpenIPOS Global 算力节点")
|
| 16 |
gr.Markdown("### DeepSeek-R1 32B 满血版演示站")
|
| 17 |
|
| 18 |
+
# 核心聊天组件(去掉了导致报错的 type 参数)
|
| 19 |
gr.ChatInterface(
|
| 20 |
chat_fn,
|
|
|
|
| 21 |
description="本节点由 OpenIPOS 提供法律级高逻辑推理算力支持。",
|
| 22 |
)
|
| 23 |
|