Spaces:
Running on Zero
Running on Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -8,15 +8,19 @@ sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "src")))
|
|
| 8 |
|
| 9 |
from backend.main import app as fastapi_app
|
| 10 |
|
|
|
|
| 11 |
# Dummy GPU function to satisfy ZeroGPU hardware requirements
|
| 12 |
@spaces.GPU
|
| 13 |
def fake_gpu_function():
|
| 14 |
return "BrainBox Backend API is running! Access the frontend to use it."
|
| 15 |
|
|
|
|
|
|
|
|
|
|
| 16 |
# Dummy Gradio app to satisfy Hugging Face Spaces routing requirements
|
| 17 |
demo = gr.Interface(
|
| 18 |
-
fn=fake_gpu_function,
|
| 19 |
-
inputs=[],
|
| 20 |
outputs="text",
|
| 21 |
title="BrainBox API Core"
|
| 22 |
)
|
|
|
|
| 8 |
|
| 9 |
from backend.main import app as fastapi_app
|
| 10 |
|
| 11 |
+
# Dummy GPU function to satisfy ZeroGPU hardware requirements
|
| 12 |
# Dummy GPU function to satisfy ZeroGPU hardware requirements
|
| 13 |
@spaces.GPU
|
| 14 |
def fake_gpu_function():
|
| 15 |
return "BrainBox Backend API is running! Access the frontend to use it."
|
| 16 |
|
| 17 |
+
# FIX: Explicitly invoke the function once during startup to register the ZeroGPU daemon
|
| 18 |
+
fake_gpu_function()
|
| 19 |
+
|
| 20 |
# Dummy Gradio app to satisfy Hugging Face Spaces routing requirements
|
| 21 |
demo = gr.Interface(
|
| 22 |
+
fn=fake_gpu_function,
|
| 23 |
+
inputs=[],
|
| 24 |
outputs="text",
|
| 25 |
title="BrainBox API Core"
|
| 26 |
)
|