Spaces:
Sleeping
Sleeping
Download App/main.py from Diaure/Futurisys_API_ML: direct link, hf CLI and curl.
- Browser
- Download file 518 Bytes
-
https://huggingface.co/spaces/Diaure/Futurisys_API_ML/resolve/main/App/main.py
- Command line
-
hf download hf://spaces/Diaure/Futurisys_API_ML/App/main.py
-
curl -L -o main.py https://huggingface.co/spaces/Diaure/Futurisys_API_ML/resolve/main/App/main.py
518 Bytes
| from fastapi import FastAPI | |
| from App.schemas import EmployeeFeatures | |
| from App.predict import predict_employee | |
| app = FastAPI( | |
| title = "Futurisys ML API", | |
| description = "API de prédiction du départ des employés", | |
| version="0.1.0" | |
| ) | |
| def root(): | |
| return {"status": "API OK"} | |
| def predict(data: EmployeeFeatures): | |
| """ | |
| Prédit la probabilité de départ d'un employé à partir de ses caractéristiques. | |
| """ | |
| return predict_employee(data.model_dump()) | |