Update app.py
Browse files
app.py
CHANGED
|
@@ -155,7 +155,6 @@ def save_qa_history(history_entry):
|
|
| 155 |
st.error(f"File reading error: {str(file_err)}")
|
| 156 |
history_data = []
|
| 157 |
else:
|
| 158 |
-
st.info("No existing history file found, creating new one")
|
| 159 |
history_data = []
|
| 160 |
|
| 161 |
# Append new entry
|
|
@@ -186,7 +185,6 @@ def save_qa_history(history_entry):
|
|
| 186 |
json_content = json.dumps(history_data, ensure_ascii=False, indent=2)
|
| 187 |
with open("qa_history.json", "w", encoding="utf-8") as f:
|
| 188 |
f.write(json_content)
|
| 189 |
-
st.success("Successfully saved history locally")
|
| 190 |
except Exception as save_err:
|
| 191 |
st.error(f"Error saving history locally: {str(save_err)}")
|
| 192 |
return
|
|
@@ -206,7 +204,6 @@ def save_qa_history(history_entry):
|
|
| 206 |
try:
|
| 207 |
# Try to get the file first
|
| 208 |
contents = repo.get_contents("qa_history.json")
|
| 209 |
-
st.info("Existing qa_history.json found, updating...")
|
| 210 |
|
| 211 |
# Ensure content is properly encoded
|
| 212 |
content = json.dumps(history_data, ensure_ascii=False, indent=2)
|
|
@@ -220,7 +217,6 @@ def save_qa_history(history_entry):
|
|
| 220 |
)
|
| 221 |
|
| 222 |
except Exception as file_error:
|
| 223 |
-
st.info("File not found, creating new qa_history.json...")
|
| 224 |
# File doesn't exist, create it
|
| 225 |
content = json.dumps(history_data, ensure_ascii=False, indent=2)
|
| 226 |
response = repo.create_file(
|
|
|
|
| 155 |
st.error(f"File reading error: {str(file_err)}")
|
| 156 |
history_data = []
|
| 157 |
else:
|
|
|
|
| 158 |
history_data = []
|
| 159 |
|
| 160 |
# Append new entry
|
|
|
|
| 185 |
json_content = json.dumps(history_data, ensure_ascii=False, indent=2)
|
| 186 |
with open("qa_history.json", "w", encoding="utf-8") as f:
|
| 187 |
f.write(json_content)
|
|
|
|
| 188 |
except Exception as save_err:
|
| 189 |
st.error(f"Error saving history locally: {str(save_err)}")
|
| 190 |
return
|
|
|
|
| 204 |
try:
|
| 205 |
# Try to get the file first
|
| 206 |
contents = repo.get_contents("qa_history.json")
|
|
|
|
| 207 |
|
| 208 |
# Ensure content is properly encoded
|
| 209 |
content = json.dumps(history_data, ensure_ascii=False, indent=2)
|
|
|
|
| 217 |
)
|
| 218 |
|
| 219 |
except Exception as file_error:
|
|
|
|
| 220 |
# File doesn't exist, create it
|
| 221 |
content = json.dumps(history_data, ensure_ascii=False, indent=2)
|
| 222 |
response = repo.create_file(
|