Spaces:
Running on Zero
Running on Zero
nitish17855 commited on
Commit ·
0f1912f
1
Parent(s): d45cfb0
Add @spaces.GPU anchor for ZeroGPU startup compatibility
Browse files
app.py
CHANGED
|
@@ -25,6 +25,17 @@ import gradio as gr
|
|
| 25 |
import uvicorn
|
| 26 |
from api.main import app
|
| 27 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 28 |
# Minimal Gradio helper block mounted at /gradio
|
| 29 |
with gr.Blocks(title="AURA CRAG Studio") as demo:
|
| 30 |
gr.Markdown("# ⚡ AURA CRAG — Enterprise Financial Intelligence")
|
|
@@ -33,6 +44,8 @@ with gr.Blocks(title="AURA CRAG Studio") as demo:
|
|
| 33 |
"[**Click here to launch the Full Glass-Box Studio**](/) "
|
| 34 |
"or access the [**Swagger OpenAPI Docs**](/docs)."
|
| 35 |
)
|
|
|
|
|
|
|
| 36 |
|
| 37 |
# Mount Gradio onto the existing FastAPI application
|
| 38 |
# Root '/' continues to serve our custom warm Split-Screen Studio UI!
|
|
|
|
| 25 |
import uvicorn
|
| 26 |
from api.main import app
|
| 27 |
|
| 28 |
+
# ZeroGPU Compatibility Anchor
|
| 29 |
+
try:
|
| 30 |
+
import spaces
|
| 31 |
+
|
| 32 |
+
@spaces.GPU
|
| 33 |
+
def zero_gpu_anchor():
|
| 34 |
+
return True
|
| 35 |
+
except Exception:
|
| 36 |
+
def zero_gpu_anchor():
|
| 37 |
+
return True
|
| 38 |
+
|
| 39 |
# Minimal Gradio helper block mounted at /gradio
|
| 40 |
with gr.Blocks(title="AURA CRAG Studio") as demo:
|
| 41 |
gr.Markdown("# ⚡ AURA CRAG — Enterprise Financial Intelligence")
|
|
|
|
| 44 |
"[**Click here to launch the Full Glass-Box Studio**](/) "
|
| 45 |
"or access the [**Swagger OpenAPI Docs**](/docs)."
|
| 46 |
)
|
| 47 |
+
_gpu_btn = gr.Button("GPU Check", visible=False)
|
| 48 |
+
_gpu_btn.click(fn=zero_gpu_anchor)
|
| 49 |
|
| 50 |
# Mount Gradio onto the existing FastAPI application
|
| 51 |
# Root '/' continues to serve our custom warm Split-Screen Studio UI!
|