Spaces:
Running
Running
Update models.py
Browse files
models.py
CHANGED
@@ -1,22 +1,24 @@
|
|
1 |
-
# models.py
|
2 |
-
|
3 |
import gradio as gr
|
4 |
-
import spaces
|
5 |
import types
|
6 |
|
7 |
# Create a local "transformers_gradio" object to mimic the missing package
|
8 |
transformers_gradio = types.SimpleNamespace(registry="huggingface")
|
9 |
|
10 |
-
#
|
11 |
-
|
12 |
-
|
13 |
-
|
|
|
|
|
|
|
14 |
|
15 |
-
#
|
16 |
-
|
|
|
17 |
|
18 |
-
|
19 |
-
fn
|
|
|
20 |
|
21 |
if __name__ == "__main__":
|
22 |
-
demo.launch()
|
|
|
|
|
|
|
1 |
import gradio as gr
|
|
|
2 |
import types
|
3 |
|
4 |
# Create a local "transformers_gradio" object to mimic the missing package
|
5 |
transformers_gradio = types.SimpleNamespace(registry="huggingface")
|
6 |
|
7 |
+
# Load Gradio interfaces with the appropriate registry
|
8 |
+
demo_distill = gr.load(name="deepseek-ai/DeepSeek-R1-Distill-Qwen-32B", src=transformers_gradio.registry)
|
9 |
+
demo_r1 = gr.load(name="deepseek-ai/DeepSeek-R1", src=transformers_gradio.registry)
|
10 |
+
demo_zero = gr.load(name="deepseek-ai/DeepSeek-R1-Zero", src=transformers_gradio.registry)
|
11 |
+
|
12 |
+
# Example usage: Assign one of the models as the default demo
|
13 |
+
demo = demo_distill
|
14 |
|
15 |
+
# Add functionality to demo
|
16 |
+
if hasattr(demo, "fn"):
|
17 |
+
demo.fn = demo.fn
|
18 |
|
19 |
+
if hasattr(demo, "fns"):
|
20 |
+
for fn in demo.fns.values():
|
21 |
+
fn.api_name = False
|
22 |
|
23 |
if __name__ == "__main__":
|
24 |
+
demo.launch()
|