Chandranshu Jain commited on
Commit
dff4bc2
·
verified ·
1 Parent(s): b7a7568

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -10,7 +10,7 @@ from langchain.prompts import PromptTemplate
10
  from langchain_community.document_loaders import PyPDFLoader
11
  from langchain_chroma import Chroma
12
  import io
13
- import fitz
14
 
15
  st.set_page_config(page_title="Document Genie", layout="wide")
16
 
@@ -35,8 +35,9 @@ Follow these simple steps to interact with the chatbot:
35
 
36
  def get_pdf(pdf_file):
37
  # Extract file path from UploadedFile object
38
- file_pdf = fitz.open(stream=pdf_file.read(), filetype="pdf")
39
- docs = file_pdf.load()
 
40
  return docs
41
 
42
  def text_splitter(text):
 
10
  from langchain_community.document_loaders import PyPDFLoader
11
  from langchain_chroma import Chroma
12
  import io
13
+ from streamlit import session_state as ss
14
 
15
  st.set_page_config(page_title="Document Genie", layout="wide")
16
 
 
35
 
36
  def get_pdf(pdf_file):
37
  # Extract file path from UploadedFile object
38
+ with open(pdf_file, "rb") as f:
39
+ loader = PyPDFLoader(f)
40
+ docs = file_pdf.load()
41
  return docs
42
 
43
  def text_splitter(text):