Spaces:
Sleeping
Sleeping
fix: add @spaces.GPU decorator for ZeroGPU compatibility
Browse files
app.py
CHANGED
|
@@ -660,8 +660,10 @@ load_models()
|
|
| 660 |
# Flask directly via gunicorn. This block is kept for legacy compatibility.
|
| 661 |
try:
|
| 662 |
import gradio as gr
|
|
|
|
| 663 |
from fastapi.middleware.wsgi import WSGIMiddleware
|
| 664 |
|
|
|
|
| 665 |
def predict_gradio(statement, model_type):
|
| 666 |
if not statement or len(statement) < 5:
|
| 667 |
return "Please enter a statement with at least 5 characters."
|
|
|
|
| 660 |
# Flask directly via gunicorn. This block is kept for legacy compatibility.
|
| 661 |
try:
|
| 662 |
import gradio as gr
|
| 663 |
+
import spaces
|
| 664 |
from fastapi.middleware.wsgi import WSGIMiddleware
|
| 665 |
|
| 666 |
+
@spaces.GPU
|
| 667 |
def predict_gradio(statement, model_type):
|
| 668 |
if not statement or len(statement) < 5:
|
| 669 |
return "Please enter a statement with at least 5 characters."
|