JBHF commited on
Commit
523a632
1 Parent(s): 9f8913a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -1
app.py CHANGED
@@ -77,7 +77,14 @@ if "vector" not in st.session_state:
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
 
 
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
+ # JB:
85
+ # https://python.langchain.com/docs/modules/data_connection/document_loaders/file_directory
86
+ text_loader_kwargs={'autodetect_encoding': True}
87
+ loader = DirectoryLoader(path, glob="**/*.pdf", loader_cls=TextLoader, loader_kwargs=text_loader_kwargs)
88
  docs = loader.load()
89
  st.session_state.docs = docs
90