MAS-AI-0000 commited on
Commit
f9710b0
·
verified ·
1 Parent(s): 387e9f1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -87,9 +87,10 @@ async def predict_text_endpoint(payload: TextPredictionRequest = Body(...)):
87
 
88
  return TextPredictionResponse(
89
  predicted_class=result["predicted_class"],
90
- confidence=result["confidence"]
 
91
  )
92
  except Exception as e:
93
  # Return a fallback response in case of error
94
  print(f"Error in text prediction: {e}")
95
- return TextPredictionResponse(predicted_class="Human", confidence=0.5)
 
87
 
88
  return TextPredictionResponse(
89
  predicted_class=result["predicted_class"],
90
+ confidence_ai=result["confidence_ai"],
91
+ confidence_human=result["confidence_human"]
92
  )
93
  except Exception as e:
94
  # Return a fallback response in case of error
95
  print(f"Error in text prediction: {e}")
96
+ return TextPredictionResponse(predicted_class="Human", confidence_ai=-100.0, confidence_human=-100.0)