INNER CODE UNIT · Python

health

DataTalksClub/machine-learning-zoomcamp · cohorts/2026/10-kubernetes/workshop/service/app.py:74

def health():
    return {"status": "healthy"}


@app.post("/predict", response_model=PredictResponse)
def predict_endpoint(request: PredictRequest):
    predictions, top_class, top_prob = predict(str(request.url))
    
    return PredictResponse(
        predictions=predictions,
        top_class=top_class,
        top_probability=top_prob
    )


if __name__ == "__main__":
    uvicorn.run(app, host="0.0.0.0", port=8080)

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…