AxionLabsAI commited on
Commit
a739aad
Β·
verified Β·
1 Parent(s): 8733d40

Add ZeroGPU startup compatibility marker

Browse files
Files changed (1) hide show
  1. app.py +7 -0
app.py CHANGED
@@ -7,6 +7,7 @@ import threading
7
  import queue as queue_mod
8
  import uvicorn
9
  import gradio as gr
 
10
  from fastapi import FastAPI, Request
11
  from fastapi.responses import StreamingResponse, JSONResponse
12
  from huggingface_hub import hf_hub_download
@@ -127,6 +128,12 @@ def _load_model():
127
  threading.Thread(target=_load_model, daemon=True).start()
128
 
129
 
 
 
 
 
 
 
130
  # ── Gradio chat helpers ───────────────────────────────────────────────────────
131
 
132
  def user_submit(message, history):
 
7
  import queue as queue_mod
8
  import uvicorn
9
  import gradio as gr
10
+ import spaces
11
  from fastapi import FastAPI, Request
12
  from fastapi.responses import StreamingResponse, JSONResponse
13
  from huggingface_hub import hf_hub_download
 
128
  threading.Thread(target=_load_model, daemon=True).start()
129
 
130
 
131
+ # ZeroGPU requires one decorated function even though inference stays on CPU.
132
+ @spaces.GPU
133
+ def _zerogpu_compatibility_marker():
134
+ return True
135
+
136
+
137
  # ── Gradio chat helpers ───────────────────────────────────────────────────────
138
 
139
  def user_submit(message, history):