Spaces:
Runtime error
Runtime error
Add ZeroGPU startup compatibility marker
Browse files
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):
|