INNER CODE UNIT · Python
index
psalias2006/gpu-hot · app.py:55
async def index():
"""Serve the main dashboard"""
with open("templates/index.html", "r") as f:
return HTMLResponse(content=f.read())
@app.get("/api/gpu-data")
async def api_gpu_data():
"""REST API endpoint for GPU data"""
if config.MODE == 'hub':
return {"gpus": {}, "timestamp": "hub_mode"}
if hasattr(monitor_or_hub, 'get_gpu_data'):
return {"gpus": await monitor_or_hub.get_gpu_data(), "timestamp": "async"}
return {"gpus": {}, "timestamp": "no_data"}