Spaces:
Sleeping
Sleeping
Update src/streamlit_app.py
Browse files- src/streamlit_app.py +3 -1
src/streamlit_app.py
CHANGED
|
@@ -61,6 +61,8 @@ def show_img(img_id, score=None, col=None):
|
|
| 61 |
# Hiển thị ảnh trong cột
|
| 62 |
if col:
|
| 63 |
col.image(img, caption=text, use_container_width=True)
|
|
|
|
|
|
|
| 64 |
|
| 65 |
except requests.exceptions.RequestException as e:
|
| 66 |
st.error(f"Error fetching image: {e}")
|
|
@@ -84,7 +86,7 @@ def search_faiss(model, processor, index, id_map, prompt, top_k=5, device='cpu')
|
|
| 84 |
st.write("FAISS search completed.")
|
| 85 |
st.write("Indices returned:", I[0])
|
| 86 |
st.write("Scores returned:", D[0])
|
| 87 |
-
st.write("ID map keys sample:", list(id_map.keys())[:10])
|
| 88 |
return [(id_map[i], float(D[0][j])) for j, i in enumerate(I[0])]
|
| 89 |
|
| 90 |
def running(prompt, top_k=5):
|
|
|
|
| 61 |
# Hiển thị ảnh trong cột
|
| 62 |
if col:
|
| 63 |
col.image(img, caption=text, use_container_width=True)
|
| 64 |
+
else:
|
| 65 |
+
st.write("img_style is empty")
|
| 66 |
|
| 67 |
except requests.exceptions.RequestException as e:
|
| 68 |
st.error(f"Error fetching image: {e}")
|
|
|
|
| 86 |
st.write("FAISS search completed.")
|
| 87 |
st.write("Indices returned:", I[0])
|
| 88 |
st.write("Scores returned:", D[0])
|
| 89 |
+
# st.write("ID map keys sample:", list(id_map.keys())[:10])
|
| 90 |
return [(id_map[i], float(D[0][j])) for j, i in enumerate(I[0])]
|
| 91 |
|
| 92 |
def running(prompt, top_k=5):
|