Update app.py
Browse files
app.py
CHANGED
@@ -104,11 +104,16 @@ if option == "Ask a Question":
|
|
104 |
# View previous conversations
|
105 |
elif option == "View Previous Conversations":
|
106 |
if os.path.exists(conversation_file):
|
107 |
-
|
108 |
-
|
|
|
|
|
|
|
|
|
109 |
else:
|
110 |
st.warning("No previous conversations found.")
|
111 |
|
|
|
112 |
# View data summary
|
113 |
elif option == "View Data Summary":
|
114 |
if os.path.exists(summary_file):
|
|
|
104 |
# View previous conversations
|
105 |
elif option == "View Previous Conversations":
|
106 |
if os.path.exists(conversation_file):
|
107 |
+
try:
|
108 |
+
with open(conversation_file, "r", encoding="utf-8", errors="replace") as file:
|
109 |
+
content = file.read()
|
110 |
+
st.text_area("Previous Conversations", content, height=300)
|
111 |
+
except Exception as e:
|
112 |
+
st.error(f"An error occurred while reading the file: {e}")
|
113 |
else:
|
114 |
st.warning("No previous conversations found.")
|
115 |
|
116 |
+
|
117 |
# View data summary
|
118 |
elif option == "View Data Summary":
|
119 |
if os.path.exists(summary_file):
|