Spaces:
Runtime error
Runtime error
Update main.py
Browse files
main.py
CHANGED
|
@@ -55,6 +55,6 @@ async def predict(file: UploadFile = File(...)):
|
|
| 55 |
|
| 56 |
# Check if the predicted probability meets the class-specific threshold
|
| 57 |
if predicted_probability < thresholds[predicted_idx]:
|
| 58 |
-
return {'predicted_class': 'uncertain', 'accuracy': predicted_probability}
|
| 59 |
else:
|
| 60 |
-
return {'predicted_class': predicted_label, 'accuracy': predicted_probability}
|
|
|
|
| 55 |
|
| 56 |
# Check if the predicted probability meets the class-specific threshold
|
| 57 |
if predicted_probability < thresholds[predicted_idx]:
|
| 58 |
+
return {'predicted_class': 'uncertain', 'accuracy': float(predicted_probability)}
|
| 59 |
else:
|
| 60 |
+
return {'predicted_class': predicted_label, 'accuracy': float(predicted_probability)}
|