Spaces:
Runtime error
Runtime error
fix: index error
Browse files
app.py
CHANGED
@@ -33,5 +33,8 @@ result = semantic_search(text_emb, img_emb, top_k=6)[0]
|
|
33 |
columns = st.columns(3) + st.columns(3)
|
34 |
for i, col in enumerate(columns):
|
35 |
photo_id = img_id[result[i]["corpus_id"]]
|
36 |
-
|
|
|
|
|
|
|
37 |
col.image(img_url, use_column_width=True)
|
|
|
33 |
columns = st.columns(3) + st.columns(3)
|
34 |
for i, col in enumerate(columns):
|
35 |
photo_id = img_id[result[i]["corpus_id"]]
|
36 |
+
target_series = info.loc[info["photo_id"] == photo_id, "photo_image_url"]
|
37 |
+
if len(target_series) == 0:
|
38 |
+
continue
|
39 |
+
img_url = target_series.iloc[0]
|
40 |
col.image(img_url, use_column_width=True)
|