Spaces:
Running
on
Zero
Running
on
Zero
Commit
·
f3bd749
1
Parent(s):
a6f24fe
fix: import ensemble predictor at startup for ZeroGPU detection
Browse filesThe @spaces.GPU decorator needs to be in a module that's imported at
app startup for ZeroGPU detection to find it. Previously the module
was lazily imported inside a function, causing the detection to fail.
app.py
CHANGED
|
@@ -76,6 +76,10 @@ from backend.rate_limiting.fixed_window import TieredFixedWindowLimiter
|
|
| 76 |
from backend.auth import auth, UserSession
|
| 77 |
from backend.export import export_analysis_to_csv, export_analysis_to_pdf
|
| 78 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 79 |
def check_authentication(session_state: Dict) -> bool:
|
| 80 |
"""Check if user is authenticated or in demo mode."""
|
| 81 |
if not session_state:
|
|
|
|
| 76 |
from backend.auth import auth, UserSession
|
| 77 |
from backend.export import export_analysis_to_csv, export_analysis_to_pdf
|
| 78 |
|
| 79 |
+
# Import ensemble predictor at startup so @spaces.GPU decorator is detected by ZeroGPU
|
| 80 |
+
# This module contains GPU-accelerated ML forecasting (Chronos, TTM, N-HiTS)
|
| 81 |
+
import backend.mcp_servers.ensemble_predictor_mcp # noqa: F401
|
| 82 |
+
|
| 83 |
def check_authentication(session_state: Dict) -> bool:
|
| 84 |
"""Check if user is authenticated or in demo mode."""
|
| 85 |
if not session_state:
|