Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -27,7 +27,7 @@ def query(image, top_k=4):
|
|
| 27 |
logits = results[1][0].tolist()
|
| 28 |
images = ds.select(inx)["image"]
|
| 29 |
captions = ds.select(inx)["label"]
|
| 30 |
-
images_with_captions = [(i, c) for i, c in zip(images, captions)]
|
| 31 |
labels_with_probs = dict(zip(captions, logits))
|
| 32 |
labels_with_probs = {k: 1 - v for k, v in labels_with_probs.items()}
|
| 33 |
try:
|
|
|
|
| 27 |
logits = results[1][0].tolist()
|
| 28 |
images = ds.select(inx)["image"]
|
| 29 |
captions = ds.select(inx)["label"]
|
| 30 |
+
images_with_captions = [(i, ds.features["label"].int2str(c)) for i, c in zip(images, captions)]
|
| 31 |
labels_with_probs = dict(zip(captions, logits))
|
| 32 |
labels_with_probs = {k: 1 - v for k, v in labels_with_probs.items()}
|
| 33 |
try:
|