Spaces:
Sleeping
Sleeping
Upload main.py
Browse files
main.py
CHANGED
|
@@ -129,19 +129,16 @@ def llm_response(query):
|
|
| 129 |
[f"[{i}]: [{title}]({link})" for i, (title, link) in enumerate(zip(titles, links), start=1)]
|
| 130 |
)
|
| 131 |
markdown_list = f"{answer_with_citations}{citations_section}"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 132 |
|
| 133 |
-
markdown_list += f"\n\n\nHere is a list of articles that can provide more information about your inquiry:\n"
|
| 134 |
-
markdown_list += "\n".join([f"- [{res_title}]({res_link})" for res_title, res_link in zip(res_titles, res_links)])
|
| 135 |
|
| 136 |
-
# Combine answer and citations for final markdown output
|
| 137 |
-
|
| 138 |
-
# if not res_links:
|
| 139 |
-
# return markdown_list
|
| 140 |
-
# else:
|
| 141 |
-
# markdown_list += f"\n\n\nHere is a list of articles that can provide more information about your inquiry:\n"
|
| 142 |
-
# markdown_list += "\n".join([f"- [{res_title}]({res_link})" for res_title, res_link in zip(res_titles, res_links)])
|
| 143 |
-
|
| 144 |
-
|
| 145 |
except OutputParserException:
|
| 146 |
markdown_list = "There are no articles relevant to your inquiry..."
|
| 147 |
return markdown_list
|
|
|
|
| 129 |
[f"[{i}]: [{title}]({link})" for i, (title, link) in enumerate(zip(titles, links), start=1)]
|
| 130 |
)
|
| 131 |
markdown_list = f"{answer_with_citations}{citations_section}"
|
| 132 |
+
# Combine answer and citations for final markdown output
|
| 133 |
+
|
| 134 |
+
|
| 135 |
+
if not res_links:
|
| 136 |
+
return markdown_list
|
| 137 |
+
else:
|
| 138 |
+
markdown_list += f"\n\n\nHere is a list of articles that can provide more information about your inquiry:\n"
|
| 139 |
+
markdown_list += "\n".join([f"- [{res_title}]({res_link})" for res_title, res_link in zip(res_titles, res_links)])
|
| 140 |
|
|
|
|
|
|
|
| 141 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 142 |
except OutputParserException:
|
| 143 |
markdown_list = "There are no articles relevant to your inquiry..."
|
| 144 |
return markdown_list
|