Spaces:
Running on Zero
Running on Zero
kwabs22 Claude Opus 5.5 commited on
Commit ·
065c4f9
1
Parent(s): 77b3711
Add ZeroGPU entry point for the generation tier
Browse filesZeroGPU refuses to start without a @spaces.GPU function. The decorated
generate_mesh is reserved for text-to-3D and is not called yet.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- app.py +11 -0
- requirements.txt +1 -0
app.py
CHANGED
|
@@ -9,6 +9,7 @@ import re
|
|
| 9 |
import tempfile
|
| 10 |
import threading
|
| 11 |
|
|
|
|
| 12 |
import gradio as gr
|
| 13 |
|
| 14 |
from vli import assets, pipeline, scene, simplify, vlm
|
|
@@ -22,6 +23,16 @@ def _fail(e):
|
|
| 22 |
raise gr.Error(str(e))
|
| 23 |
|
| 24 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 25 |
# ---------------- MCP tools ----------------
|
| 26 |
|
| 27 |
def check_words(sentence: str, primitives_json: str = "{}") -> str:
|
|
|
|
| 9 |
import tempfile
|
| 10 |
import threading
|
| 11 |
|
| 12 |
+
import spaces # ZeroGPU: import before any CUDA-touching library
|
| 13 |
import gradio as gr
|
| 14 |
|
| 15 |
from vli import assets, pipeline, scene, simplify, vlm
|
|
|
|
| 23 |
raise gr.Error(str(e))
|
| 24 |
|
| 25 |
|
| 26 |
+
@spaces.GPU(duration=60)
|
| 27 |
+
def generate_mesh(prompt):
|
| 28 |
+
"""GPU entry point for the generation tier (last in the fallback chain).
|
| 29 |
+
|
| 30 |
+
ZeroGPU needs a @spaces.GPU function at startup. Nothing calls this until
|
| 31 |
+
text-to-3D is wired in, so no quota is used.
|
| 32 |
+
"""
|
| 33 |
+
raise NotImplementedError("generation tier is not wired up yet")
|
| 34 |
+
|
| 35 |
+
|
| 36 |
# ---------------- MCP tools ----------------
|
| 37 |
|
| 38 |
def check_words(sentence: str, primitives_json: str = "{}") -> str:
|
requirements.txt
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
|
|
| 1 |
gradio[mcp]
|
| 2 |
huggingface_hub
|
| 3 |
requests
|
|
|
|
| 1 |
+
spaces
|
| 2 |
gradio[mcp]
|
| 3 |
huggingface_hub
|
| 4 |
requests
|