shukdevdatta123 commited on
Commit
cf56666
·
verified ·
1 Parent(s): f481ae9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -2
app.py CHANGED
@@ -116,11 +116,16 @@ elif option == "View Previous Conversations":
116
  # View data summary
117
  elif option == "View Data Summary":
118
  if os.path.exists(summary_file):
119
- with open(summary_file, "r") as file:
120
- st.text_area("Data Summary", file.read(), height=300)
 
 
 
 
121
  else:
122
  st.warning("No data summary found.")
123
 
 
124
  # Save a note
125
  elif option == "Save a Note":
126
  note = st.text_input("Enter a note to save:")
 
116
  # View data summary
117
  elif option == "View Data Summary":
118
  if os.path.exists(summary_file):
119
+ try:
120
+ with open(summary_file, "r", encoding="utf-8", errors="replace") as file:
121
+ content = file.read()
122
+ st.text_area("Data Summary", content, height=300)
123
+ except Exception as e:
124
+ st.error(f"An error occurred while reading the file: {e}")
125
  else:
126
  st.warning("No data summary found.")
127
 
128
+
129
  # Save a note
130
  elif option == "Save a Note":
131
  note = st.text_input("Enter a note to save:")