StanKarz commited on
Commit
628f938
·
verified ·
1 Parent(s): 72c5c6e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -14,7 +14,8 @@ def predict(img):
14
  # Fetch the labels dynamically from the model's vocabulary
15
  labels = learn.dls.vocab
16
  # Ensure probabilities are floats
17
- return {labels[i]: {float(probs[i]) for i in range(len(labels))}
 
18
  except Exception as e:
19
  # Log the exception and return it as an error message
20
  print(f"An error occurred: {e}")
 
14
  # Fetch the labels dynamically from the model's vocabulary
15
  labels = learn.dls.vocab
16
  # Ensure probabilities are floats
17
+ return {labels[i]: float(probs[i]) for i in range(len(labels))}
18
+
19
  except Exception as e:
20
  # Log the exception and return it as an error message
21
  print(f"An error occurred: {e}")