Update app.py
Browse files
app.py
CHANGED
|
@@ -464,7 +464,14 @@ def display_source_documents_with_images(source_documents, query):
|
|
| 464 |
highlighted_snippet = highlight_query_words(snippet, query)
|
| 465 |
|
| 466 |
st.markdown(f'<div class="source-content">{highlighted_snippet}</div>', unsafe_allow_html=True)
|
| 467 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 468 |
|
| 469 |
logger.debug(f"Successfully displayed content for {pdf_name}, page {page_number + 1}")
|
| 470 |
|
|
|
|
| 464 |
highlighted_snippet = highlight_query_words(snippet, query)
|
| 465 |
|
| 466 |
st.markdown(f'<div class="source-content">{highlighted_snippet}</div>', unsafe_allow_html=True)
|
| 467 |
+
# Define the base URL for Hugging Face Spaces (replace this with your actual space URL)
|
| 468 |
+
BASE_URL = "https://huggingface.co/spaces/bacancydataprophets/Smart-PDF-Search/"
|
| 469 |
+
# Construct the full URL
|
| 470 |
+
url = f"{BASE_URL}?page=pdf_details&filename={pdf_name}&page_number={page_number}"
|
| 471 |
+
|
| 472 |
+
# Use markdown to display the link
|
| 473 |
+
st.markdown(f"[View other results in this book]({url})", unsafe_allow_html=True)
|
| 474 |
+
# st.markdown(f"[View other results in this book](?page=pdf_details&filename={pdf_name}&page_number={page_number})", unsafe_allow_html=True)
|
| 475 |
|
| 476 |
logger.debug(f"Successfully displayed content for {pdf_name}, page {page_number + 1}")
|
| 477 |
|