Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -178,9 +178,10 @@ if search_buttion or prev_query != str(query_input):
|
|
178 |
results = zip(range(len(distances)), distances)
|
179 |
results = sorted(results, key=lambda x: x[1])
|
180 |
|
181 |
-
for idx, distance in results[0:closest_n]:
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
)
|
|
|
|
178 |
results = zip(range(len(distances)), distances)
|
179 |
results = sorted(results, key=lambda x: x[1])
|
180 |
|
181 |
+
for i, (idx, distance) in enumerate(results[0:closest_n]):
|
182 |
+
md_content = ""
|
183 |
+
page_url = df.iloc[idx]["page"]
|
184 |
+
for img in df.iloc[idx]["imgs"]:
|
185 |
+
md_content += f'<a href="{page_url}" target="_blank" rel="noopener noreferrer"><img src="{img}" width="100"></a>'
|
186 |
+
md_content += f'\n[%.4f {df.iloc[idx]["title"]}]({page_url})' % (distance / 2)
|
187 |
+
st.markdown(md_content, unsafe_allow_html=True)
|