KushwanthK commited on
Commit
f98ad5c
·
verified ·
1 Parent(s): a5d883c

Upload app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -6
app.py CHANGED
@@ -490,13 +490,15 @@ def display_highlighted_pdf():
490
  sources = [7,8]
491
  response_text = "I offer my respectful obeisances unto the lotus feet of my spiritual master and unto the feet of all Vaiñëavas. I offer my respectful"
492
 
493
- pdf_path = highlight_pdf(file_path=file_path, text_to_highlight=response_text, page_numbers=sources)
494
 
495
- with open(pdf_path, "rb") as file:
496
- pdf_bytes = file.read()
497
- base64_pdf = base64.b64encode(pdf_bytes).decode("utf-8")
498
- pdf_display = f'<iframe src="data:application/pdf;base64,{base64_pdf}" width="700" height="1000" type="application/pdf"></iframe>'
499
- st.markdown(pdf_display, unsafe_allow_html=True)
 
 
500
 
501
 
502
  display_highlighted_pdf()
 
490
  sources = [7,8]
491
  response_text = "I offer my respectful obeisances unto the lotus feet of my spiritual master and unto the feet of all Vaiñëavas. I offer my respectful"
492
 
493
+ highlighted_pdf_path = highlight_pdf(file_path=file_path, text_to_highlight=response_text, page_numbers=sources)
494
 
495
+ print(highlighted_pdf_path)
496
+
497
+ with open(highlighted_pdf_path, "rb") as file:
498
+ pdf_bytes = file.read()
499
+
500
+ # Use pdf_viewer to display the PDF in Streamlit
501
+ pdf_viewer(pdf_bytes, width=700)
502
 
503
 
504
  display_highlighted_pdf()