Spaces:
Running
Running
Update app.py
Browse files
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 |
-
|
|
|
|
| 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",
|
|
|
|
| 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)
|