saritha commited on
Commit
b177750
·
verified ·
1 Parent(s): b98540b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -62,7 +62,8 @@ async def initialize(file_path, question):
62
 
63
  # Generate links for each top page
64
  file_name = os.path.basename(file_path)
65
- page_links = [f"[Page {p}](file://{os.path.abspath(file_path)}#page={p})" for p in top_pages]
 
66
  page_links_str = ', '.join(page_links)
67
 
68
  if top_pages:
@@ -91,4 +92,3 @@ async def pdf_qa(file, question):
91
 
92
  # Create Gradio Interface with share=True to enable a public link
93
  gr.Interface(fn=pdf_qa, inputs=[input_file, input_question], outputs=output_text, title="PDF Question Answering System", description="Upload a PDF file and ask questions about the content.").launch(share=True)
94
- the content.").launch(share=True)
 
62
 
63
  # Generate links for each top page
64
  file_name = os.path.basename(file_path)
65
+ # Use a general link with instructions for manual navigation if automatic links are not supported
66
+ page_links = [f"[Page {p}](file://{os.path.abspath(file_path)})" for p in top_pages]
67
  page_links_str = ', '.join(page_links)
68
 
69
  if top_pages:
 
92
 
93
  # Create Gradio Interface with share=True to enable a public link
94
  gr.Interface(fn=pdf_qa, inputs=[input_file, input_question], outputs=output_text, title="PDF Question Answering System", description="Upload a PDF file and ask questions about the content.").launch(share=True)