Fix dashboard download status display, add CPU/GPU toggle and automatic fallback

This commit is contained in:
Dominic Ballenthin
2026-01-29 02:10:49 +01:00
parent ee9465f661
commit c740ec1618
5 changed files with 162 additions and 23 deletions

View File

@@ -10,7 +10,7 @@ router = APIRouter()
@router.get("/health")
async def health_check():
"""Health check endpoint with GPU status"""
"""Health check endpoint with GPU and model status"""
# Get GPU info if available
gpu_info = {"available": False}
@@ -30,11 +30,21 @@ async def health_check():
# Get system info
memory = psutil.virtual_memory()
# Get model status
model_status = get_model_info()
return {
"status": "healthy",
"version": "1.0.0",
"model": settings.whisper_model,
"gpu": gpu_info,
"model_status": {
"loaded": model_status.get("loaded", False),
"is_downloading": model_status.get("is_downloading", False),
"download_percentage": model_status.get("download_percentage", 0),
"status_message": model_status.get("status_message", "Unknown"),
"device": model_status.get("device", "cpu")
},
"system": {
"cpu_percent": psutil.cpu_percent(interval=1),
"memory_percent": memory.percent,