Sharris commited on
Commit
aded04f
Β·
verified Β·
1 Parent(s): baac404

Fix Gradio output mismatch: return tuple instead of dict for two Number components

Browse files
Files changed (1) hide show
  1. app.py +5 -4
app.py CHANGED
@@ -79,10 +79,11 @@ def predict_age(image: Image.Image):
79
  else:
80
  pred = float(pred)
81
 
82
- return {
83
- "predicted_age": round(pred, 2),
84
- "raw_output": float(pred)
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(