StanKarz commited on
Commit
0030cef
·
verified ·
1 Parent(s): 49aa24d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -15,7 +15,7 @@ def predict(img):
15
  # Get predictions from the model
16
  pred, pred_idx, probs = learn.predict(img)
17
  # Convert probabilities to percentages and construct the output dictionary dynamically
18
- return {float(labels[i]): f"{probs[i]*100:.2f}%" for i in range(len(labels))}
19
  except Exception as e:
20
  # Log the exception and return it as an error message
21
  print(f"An error occurred: {e}")
 
15
  # Get predictions from the model
16
  pred, pred_idx, probs = learn.predict(img)
17
  # Convert probabilities to percentages and construct the output dictionary dynamically
18
+ return {labels[i]: f"{float(probs[i])*100:.2f}%" for i in range(len(labels))}
19
  except Exception as e:
20
  # Log the exception and return it as an error message
21
  print(f"An error occurred: {e}")