Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -208,21 +208,22 @@ def save_conversation(chat_history, session_id, page_number):
|
|
208 |
with open(filename, 'w') as file:
|
209 |
json.dump(chat_history, file, indent=4)
|
210 |
|
211 |
-
# Git operations
|
212 |
try:
|
213 |
-
# Change directory to
|
214 |
original_dir = os.getcwd()
|
215 |
os.chdir('Chat_Store')
|
216 |
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
|
221 |
# Change back to the original directory
|
222 |
os.chdir(original_dir)
|
223 |
except Exception as e:
|
224 |
print(f"Error during Git operations: {e}")
|
225 |
|
|
|
226 |
|
227 |
|
228 |
def page1():
|
|
|
208 |
with open(filename, 'w') as file:
|
209 |
json.dump(chat_history, file, indent=4)
|
210 |
|
211 |
+
# Git operations with repo2
|
212 |
try:
|
213 |
+
# Change directory to Chat_Store for Git operations
|
214 |
original_dir = os.getcwd()
|
215 |
os.chdir('Chat_Store')
|
216 |
|
217 |
+
repo2.git_add(filename)
|
218 |
+
repo2.git_commit(f"Add conversation log for session {session_id}")
|
219 |
+
repo2.git_push()
|
220 |
|
221 |
# Change back to the original directory
|
222 |
os.chdir(original_dir)
|
223 |
except Exception as e:
|
224 |
print(f"Error during Git operations: {e}")
|
225 |
|
226 |
+
|
227 |
|
228 |
|
229 |
def page1():
|