Spaces:
Runtime error
Runtime error
Update app.py
Browse filesif no in dict -> 0
app.py
CHANGED
@@ -16,7 +16,7 @@ def greet(name):
|
|
16 |
def classify_image(img):
|
17 |
pred, idx, probs = learn.predict(img)
|
18 |
return {
|
19 |
-
price: str(prices[pred]) + ' baht (' + pred + ")",
|
20 |
label: dict(zip(learn.dls.vocab, map(float, probs))),
|
21 |
}
|
22 |
|
|
|
16 |
def classify_image(img):
|
17 |
pred, idx, probs = learn.predict(img)
|
18 |
return {
|
19 |
+
price: str(prices[pred] if pred in prices else 0) + ' baht (' + pred + ")",
|
20 |
label: dict(zip(learn.dls.vocab, map(float, probs))),
|
21 |
}
|
22 |
|