Update app.py
Browse files
app.py
CHANGED
@@ -28,22 +28,23 @@ def main():
|
|
28 |
|
29 |
data_path = "data"
|
30 |
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
if
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
|
|
47 |
|
48 |
if prompt := st.text_input("Enter your question:"):
|
49 |
msgs = st.session_state.get("chat_history", StreamlitChatMessageHistory(key="special_app_key"))
|
|
|
28 |
|
29 |
data_path = "data"
|
30 |
|
31 |
+
|
32 |
+
|
33 |
+
documents = []
|
34 |
+
|
35 |
+
for filename in os.listdir(data_path):
|
36 |
+
|
37 |
+
if filename.endswith('.txt'):
|
38 |
+
|
39 |
+
file_path = os.path.join(data_path, filename)
|
40 |
+
|
41 |
+
documents = TextLoader(file_path).load()
|
42 |
+
|
43 |
+
documents.extend(documents)
|
44 |
+
|
45 |
+
|
46 |
+
docs = split_docs(documents, 350, 40)
|
47 |
+
|
48 |
|
49 |
if prompt := st.text_input("Enter your question:"):
|
50 |
msgs = st.session_state.get("chat_history", StreamlitChatMessageHistory(key="special_app_key"))
|