Spaces:
Sleeping
Sleeping
File size: 736 Bytes
d0fda5a 62f4fb8 d0fda5a f2b90ca 5005501 d0fda5a 94dd2ae d0fda5a 9f752f4 d0fda5a 94dd2ae 62f4fb8 5005501 d0fda5a | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
import os
from fastapi import FastAPI
from src.controllers.home_controller import router as ml_home_router
from src.controllers.predict_controller import router as predict_router
from src.middleware.profiling import ProfilingMiddleware
app = FastAPI(title="ML API",
description="""
API d’inférence pour la prédiction de la solvabilité d’un prêt.
- **/predict**: prédire un résultat selon le modèle
- **/**: lister les modèles disponibles
""", version="1.0.0")
PROFILING_ENABLED = os.getenv("PROFILING_ENABLED", "true").lower() == "true"
if PROFILING_ENABLED:
app.add_middleware(
ProfilingMiddleware,
enabled=True,
)
app.include_router(ml_home_router)
app.include_router(predict_router)
|