Spaces:
Sleeping
Sleeping
agrega mensaje en root
Browse files- app/routes/home.py +8 -0
- app/routes/prediction.py +0 -1
- main.py +9 -4
app/routes/home.py
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from fastapi import APIRouter
|
| 2 |
+
|
| 3 |
+
router = APIRouter()
|
| 4 |
+
|
| 5 |
+
|
| 6 |
+
@router.get("/")
|
| 7 |
+
def read_root():
|
| 8 |
+
return {"message": "Xepelin MLOps Challenge por Santiago Battezzati"}
|
app/routes/prediction.py
CHANGED
|
@@ -16,7 +16,6 @@ def predict(request: PredictionRequest):
|
|
| 16 |
|
| 17 |
prediction_data = df.loc[request.invoiceId]
|
| 18 |
predictions = model.predict(prediction_data)
|
| 19 |
-
|
| 20 |
response_data = [
|
| 21 |
{"invoiceId": invoice_id, "prediction": float(prediction)}
|
| 22 |
for invoice_id, prediction in zip(request.invoiceId, predictions)
|
|
|
|
| 16 |
|
| 17 |
prediction_data = df.loc[request.invoiceId]
|
| 18 |
predictions = model.predict(prediction_data)
|
|
|
|
| 19 |
response_data = [
|
| 20 |
{"invoiceId": invoice_id, "prediction": float(prediction)}
|
| 21 |
for invoice_id, prediction in zip(request.invoiceId, predictions)
|
main.py
CHANGED
|
@@ -1,11 +1,16 @@
|
|
| 1 |
-
from fastapi import FastAPI
|
| 2 |
from app.routes import prediction
|
| 3 |
-
from app.
|
| 4 |
-
|
| 5 |
|
| 6 |
app = FastAPI()
|
| 7 |
|
| 8 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
app.include_router(
|
| 10 |
prediction.router,
|
| 11 |
prefix="/predict",
|
|
|
|
| 1 |
+
from fastapi import FastAPI
|
| 2 |
from app.routes import prediction
|
| 3 |
+
from app.routes import home
|
|
|
|
| 4 |
|
| 5 |
app = FastAPI()
|
| 6 |
|
| 7 |
+
|
| 8 |
+
app.include_router(
|
| 9 |
+
home.router,
|
| 10 |
+
tags=["home"],
|
| 11 |
+
)
|
| 12 |
+
|
| 13 |
+
|
| 14 |
app.include_router(
|
| 15 |
prediction.router,
|
| 16 |
prefix="/predict",
|