Update app.py
Browse files
app.py
CHANGED
@@ -76,8 +76,11 @@ if "vector" not in st.session_state:
|
|
76 |
|
77 |
# JB:
|
78 |
# https://python.langchain.com/docs/modules/data_connection/document_loaders/pdf#pypdf-directory
|
79 |
-
st.session_state.docs = st.session_state.loader.load()
|
80 |
-
|
|
|
|
|
|
|
81 |
st.session_state.text_splitter = RecursiveCharacterTextSplitter(chunk_size=1000, chunk_overlap=200)
|
82 |
st.session_state.documents = st.session_state.text_splitter.split_documents(st.session_state.docs)
|
83 |
# st.session_state.vector = FAISS.from_documents(st.session_state.documents, st.session_state.embeddings) # ORIGINAL
|
|
|
76 |
|
77 |
# JB:
|
78 |
# https://python.langchain.com/docs/modules/data_connection/document_loaders/pdf#pypdf-directory
|
79 |
+
# st.session_state.docs = st.session_state.loader.load()
|
80 |
+
loader = PyPDFDirectoryLoader("./")
|
81 |
+
docs = loader.load()
|
82 |
+
st.session_state.docs = docs
|
83 |
+
|
84 |
st.session_state.text_splitter = RecursiveCharacterTextSplitter(chunk_size=1000, chunk_overlap=200)
|
85 |
st.session_state.documents = st.session_state.text_splitter.split_documents(st.session_state.docs)
|
86 |
# st.session_state.vector = FAISS.from_documents(st.session_state.documents, st.session_state.embeddings) # ORIGINAL
|