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