Spaces:
Sleeping
Sleeping
Chandranshu Jain
commited on
Commit
•
f5711dd
1
Parent(s):
dff4bc2
Update app.py
Browse files
app.py
CHANGED
@@ -9,8 +9,7 @@ from langchain.chains.question_answering import load_qa_chain
|
|
9 |
from langchain.prompts import PromptTemplate
|
10 |
from langchain_community.document_loaders import PyPDFLoader
|
11 |
from langchain_chroma import Chroma
|
12 |
-
|
13 |
-
from streamlit import session_state as ss
|
14 |
|
15 |
st.set_page_config(page_title="Document Genie", layout="wide")
|
16 |
|
@@ -35,9 +34,8 @@ Follow these simple steps to interact with the chatbot:
|
|
35 |
|
36 |
def get_pdf(pdf_file):
|
37 |
# Extract file path from UploadedFile object
|
38 |
-
|
39 |
-
|
40 |
-
docs = file_pdf.load()
|
41 |
return docs
|
42 |
|
43 |
def text_splitter(text):
|
|
|
9 |
from langchain.prompts import PromptTemplate
|
10 |
from langchain_community.document_loaders import PyPDFLoader
|
11 |
from langchain_chroma import Chroma
|
12 |
+
|
|
|
13 |
|
14 |
st.set_page_config(page_title="Document Genie", layout="wide")
|
15 |
|
|
|
34 |
|
35 |
def get_pdf(pdf_file):
|
36 |
# Extract file path from UploadedFile object
|
37 |
+
loader = PyPDFLoader(pdf_file)
|
38 |
+
docs = loader.load()
|
|
|
39 |
return docs
|
40 |
|
41 |
def text_splitter(text):
|