Spaces:
Runtime error
Runtime error
Update app.py
Browse filesUncomment Multiple file uploading.
app.py
CHANGED
@@ -95,13 +95,13 @@ def main():
|
|
95 |
# Initialize session state
|
96 |
initialize_session_state()
|
97 |
st.title("Multi-Docs ChatBot using llama-2-7b :books:")
|
98 |
-
loader = UnstructuredFileLoader('./Freedom of Information and Protection of Privacy Act, R.S.O. 1990, c. F.31[462] - Copy.pdf')
|
99 |
-
documents = loader.load()
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
|
106 |
text_splitter=CharacterTextSplitter(separator='\n',
|
107 |
chunk_size=1500,
|
|
|
95 |
# Initialize session state
|
96 |
initialize_session_state()
|
97 |
st.title("Multi-Docs ChatBot using llama-2-7b :books:")
|
98 |
+
# loader = UnstructuredFileLoader('./Freedom of Information and Protection of Privacy Act, R.S.O. 1990, c. F.31[462] - Copy.pdf')
|
99 |
+
# documents = loader.load()
|
100 |
+
documents = []
|
101 |
+
for file_path in file_paths:
|
102 |
+
loader = UnstructuredFileLoader(file_path)
|
103 |
+
loaded_doc = loader.load() # Assuming this returns a list of pages
|
104 |
+
documents.extend(loaded_doc)
|
105 |
|
106 |
text_splitter=CharacterTextSplitter(separator='\n',
|
107 |
chunk_size=1500,
|