Spaces:
Runtime error
Runtime error
changing col name
Browse files
app.py
CHANGED
|
@@ -6,7 +6,7 @@ import wikipedia
|
|
| 6 |
|
| 7 |
|
| 8 |
# Only runs once when the script is first run.
|
| 9 |
-
with open("insectarium_768.pickle", "rb") as handle:
|
| 10 |
index = pickle.load(handle)
|
| 11 |
|
| 12 |
# Load model for computing embeddings.
|
|
@@ -26,7 +26,7 @@ def query(image, top_k=4):
|
|
| 26 |
inx = results[0][0].tolist()
|
| 27 |
logits = results[1][0].tolist()
|
| 28 |
images = ds.select(inx)["image"]
|
| 29 |
-
captions = ds.select(inx)["
|
| 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()}
|
|
|
|
| 6 |
|
| 7 |
|
| 8 |
# Only runs once when the script is first run.
|
| 9 |
+
with open("./insectarium_768.pickle", "rb") as handle:
|
| 10 |
index = pickle.load(handle)
|
| 11 |
|
| 12 |
# Load model for computing embeddings.
|
|
|
|
| 26 |
inx = results[0][0].tolist()
|
| 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()}
|