Spaces:
Runtime error
Runtime error
Fix Gradio output mismatch: return tuple instead of dict for two Number components
Browse files
app.py
CHANGED
|
@@ -79,10 +79,11 @@ def predict_age(image: Image.Image):
|
|
| 79 |
else:
|
| 80 |
pred = float(pred)
|
| 81 |
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
|
|
|
|
| 86 |
|
| 87 |
|
| 88 |
demo = gr.Interface(
|
|
|
|
| 79 |
else:
|
| 80 |
pred = float(pred)
|
| 81 |
|
| 82 |
+
# Return two separate values to match the two gr.Number outputs
|
| 83 |
+
predicted_age = round(pred, 1)
|
| 84 |
+
raw_output = float(pred)
|
| 85 |
+
|
| 86 |
+
return predicted_age, raw_output
|
| 87 |
|
| 88 |
|
| 89 |
demo = gr.Interface(
|