alibayram commited on
Commit
363a74f
·
1 Parent(s): 4172ef1

Refactor prediction function: update prediction handling to print raw predictions and extract first element

Browse files
Files changed (1) hide show
  1. app.py +7 -1
app.py CHANGED
@@ -63,7 +63,13 @@ def predict(data):
63
  img = img.reshape(1, 28, 28, 1)
64
 
65
  # Model predictions
66
- preds = model.predict(img)[0]
 
 
 
 
 
 
67
 
68
  # Return the probability for each class
69
  return {label: float(pred) for label, pred in zip(labels, preds)}
 
63
  img = img.reshape(1, 28, 28, 1)
64
 
65
  # Model predictions
66
+ preds = model.predict(img)
67
+
68
+ print(preds)
69
+
70
+ preds = preds[0]
71
+ print(preds)
72
+
73
 
74
  # Return the probability for each class
75
  return {label: float(pred) for label, pred in zip(labels, preds)}