Update app.py
Browse files
app.py
CHANGED
@@ -144,14 +144,18 @@ def save_qa_history(history_entry):
|
|
144 |
history_data.append(history_entry)
|
145 |
|
146 |
# Save updated history
|
147 |
-
with open(
|
148 |
json.dump(history_data, f, ensure_ascii=False, indent=2)
|
149 |
|
150 |
# GitHub repository path
|
151 |
-
repo_path = Path("D
|
|
|
|
|
|
|
|
|
152 |
repo = Repo(repo_path)
|
153 |
|
154 |
-
#
|
155 |
repo.git.add("qa_history.json")
|
156 |
if repo.is_dirty():
|
157 |
repo.index.commit("Update QA history")
|
|
|
144 |
history_data.append(history_entry)
|
145 |
|
146 |
# Save updated history
|
147 |
+
with open(history_file, "w", encoding="utf-8") as f:
|
148 |
json.dump(history_data, f, ensure_ascii=False, indent=2)
|
149 |
|
150 |
# GitHub repository path
|
151 |
+
repo_path = Path(r"D:\Last SWU\swu-chat-bot-project") # Update this path as per your system
|
152 |
+
if not repo_path.exists():
|
153 |
+
raise FileNotFoundError(f"Repository path does not exist: {repo_path}")
|
154 |
+
|
155 |
+
# Initialize Git repository
|
156 |
repo = Repo(repo_path)
|
157 |
|
158 |
+
# Add file to Git, commit, and push
|
159 |
repo.git.add("qa_history.json")
|
160 |
if repo.is_dirty():
|
161 |
repo.index.commit("Update QA history")
|