File size: 763 Bytes
71ab695
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# models.py

import gradio as gr
import spaces
import types

# Create a local "transformers_gradio" object to mimic the missing package
transformers_gradio = types.SimpleNamespace(registry="huggingface")

# Now the gradio.load calls will work as if we had `import transformers_gradio`
demo = gr.load(name="deepseek-ai/DeepSeek-R1-Distill-Qwen-32B", src=transformers_gradio.registry)
demo = gr.load(name="deepseek-ai/DeepSeek-R1", src=transformers_gradio.registry)
demo = gr.load(name="deepseek-ai/DeepSeek-R1-Zero", src=transformers_gradio.registry)

# Example of using spaces (assuming `spaces.GPU()` is valid in your environment)
demo.fn = spaces.GPU()(demo.fn)

for fn in demo.fns.values():
    fn.api_name = False

if __name__ == "__main__":
    demo.launch()