zhang commited on
Commit
0028657
·
verified ·
1 Parent(s): 5c882c7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -4
app.py CHANGED
@@ -1,10 +1,19 @@
1
  import gradio as gr
 
 
 
 
 
 
2
 
3
  with gr.Blocks(fill_height=True) as demo:
4
  with gr.Sidebar():
5
- gr.Markdown("# Inference Provider")
6
- gr.Markdown("This Space showcases the deepseek-ai/DeepSeek-R1-Distill-Qwen-32B model, served by the nscale API. Sign in with your Hugging Face account to use this API.")
7
- button = gr.LoginButton("Sign in")
8
- gr.load("models/deepseek-ai/DeepSeek-R1-Distill-Qwen-32B", accept_token=button, provider="nscale")
9
 
 
 
 
10
  demo.launch()
 
1
  import gradio as gr
2
+ import spaces
3
+
4
+ # 这是关键!告诉 HF 这个加载动作需要用到 ZeroGPU 算力
5
+ @spaces.GPU
6
+ def load_model():
7
+ return gr.load("models/deepseek-ai/DeepSeek-R1-Distill-Qwen-32B")
8
 
9
  with gr.Blocks(fill_height=True) as demo:
10
  with gr.Sidebar():
11
+ gr.markdown("# 🚀 OpenIPOS Global")
12
+ gr.markdown("### 专利级满血算力演示站")
13
+ gr.markdown("本节点由 OpenIPOS 运营,提供 DeepSeek-R1 32B 完整推理能力,支持超长上下文逻辑分析。")
14
+ button = gr.LoginButton("登录以开始体验")
15
 
16
+ # 这里的 load 也要包在 GPU 环境里
17
+ load_model()
18
+
19
  demo.launch()