MorganBrizon commited on
Commit
c1f6375
·
verified ·
1 Parent(s): 148cade

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -1
app.py CHANGED
@@ -63,7 +63,13 @@ async def predict_endpoint(
63
  "confidence": mean_prob
64
  }
65
  print("Prediction complete, returning response...")
66
- return JSONResponse(content=response)
 
 
 
 
 
 
67
 
68
  if __name__ == "__main__":
69
  uvicorn.run(app, host="0.0.0.0", port=7860)
 
63
  "confidence": mean_prob
64
  }
65
  print("Prediction complete, returning response...")
66
+ # Conversion des types numpy → Python natifs
67
+ response = {
68
+ "prediction": str(final_label),
69
+ "mean_probability": float(mean_prob), # <-- ✅ ici
70
+ "segment_probabilities": [float(p) for p in segment_probs] # <-- ✅ ici
71
+ }
72
+ return JSONResponse(content=response)
73
 
74
  if __name__ == "__main__":
75
  uvicorn.run(app, host="0.0.0.0", port=7860)