Spaces:
Sleeping
Sleeping
from fastapi import FastAPI | |
from dotenv import load_dotenv | |
from tasks import text, image, audio | |
from pathlib import Path | |
# Load environment variables | |
load_dotenv() | |
app = FastAPI( | |
title="Frugal AI Challenge API", | |
description="API for the Frugal AI Challenge evaluation endpoints" | |
) | |
# Include all routers | |
app.include_router(audio.router) | |
async def health_check(): | |
try: | |
model_exists = Path("/app/models/audio_model.pkl").exists() | |
return { | |
"status": "healthy", | |
"model_loaded": model_exists | |
} | |
except Exception as e: | |
return { | |
"status": "unhealthy", | |
"error": str(e) | |
} | |
async def root(): | |
return { | |
"message": "Welcome to the Frugal AI Challenge API", | |
"endpoints": { | |
"audio": "/audio - Audio classification task" | |
} | |
} | |