Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -189,11 +189,11 @@ if search_buttion or prev_query != query_input:
|
|
189 |
results = zip(range(len(distances)), distances)
|
190 |
results = sorted(results, key=lambda x: x[1])
|
191 |
|
|
|
192 |
for i, (idx, distance) in enumerate(results[0:closest_n]):
|
193 |
-
md_content = ""
|
194 |
page_url = df.iloc[idx]["page"]
|
195 |
for img_url in df.iloc[idx]["images"]:
|
196 |
-
md_content += f'<a href="{page_url}" target="_blank" rel="noopener noreferrer"><img src="{img_url}" width="100"></a>'
|
197 |
-
md_content += f'
|
198 |
|
199 |
result_text.markdown(md_content, unsafe_allow_html=True)
|
|
|
189 |
results = zip(range(len(distances)), distances)
|
190 |
results = sorted(results, key=lambda x: x[1])
|
191 |
|
192 |
+
md_content = ""
|
193 |
for i, (idx, distance) in enumerate(results[0:closest_n]):
|
|
|
194 |
page_url = df.iloc[idx]["page"]
|
195 |
for img_url in df.iloc[idx]["images"]:
|
196 |
+
md_content += f'1. <a href="{page_url}" target="_blank" rel="noopener noreferrer"><img src="{img_url}" width="100"></a>'
|
197 |
+
md_content += f' [{distance / 2:.4f}: {df.iloc[idx]["description"]}]({page_url})\n'
|
198 |
|
199 |
result_text.markdown(md_content, unsafe_allow_html=True)
|