Spaces:
Sleeping
Sleeping
Chandranshu Jain
commited on
Update app.py
Browse files
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
|
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 |
-
|
39 |
-
|
|
|
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):
|