Anne31415 commited on
Commit
7755b19
1 Parent(s): df93392

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -5
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 to push the file
212
  try:
213
- # Change directory to Private_Book for Git operations
214
  original_dir = os.getcwd()
215
  os.chdir('Chat_Store')
216
 
217
- repo.git_add(filename)
218
- repo.git_commit(f"Add conversation log for session {session_id}")
219
- repo.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
  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():