son9john commited on
Commit
8c04e14
·
1 Parent(s): 3383c45

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -98,9 +98,9 @@ def transcribe(audio, text):
98
 
99
  chat_transcript_copy = chat_transcript
100
  chat_transcript_copy += f"Number of tokens used: {num_tokens}\n\n"
101
- filename = datetime.datetime.now().strftime("%Y%m%d%H%M_conversation_history.txt")
102
  dbx.files_upload(chat_transcript_copy.encode('utf-8'), f'/{filename}', mode=dropbox.files.WriteMode.overwrite, autorename=False, client_modified=None, mute=False)
103
- dbx.files_upload(chat_transcript_copy.encode('utf-8'), '/conversation_history_note_backup.txt', mode=dropbox.files.WriteMode.overwrite, autorename=False, client_modified=None, mute=False)
104
 
105
  if num_tokens > 2200:
106
  # Reset the messages list and answer counter
@@ -128,14 +128,14 @@ def transcribe(audio, text):
128
  chat_transcript += f"[ANSWER {answer_count}]" + message['role'] + ": " + message['content'] + "\n\n"
129
  # Append the number of tokens used to the end of the chat transcript
130
 
131
- with open("conversation_history.txt", "a") as f:
132
  f.write(chat_transcript)
133
 
134
  chat_transcript_copy = chat_transcript
135
  chat_transcript_copy += f"Number of tokens used: {num_tokens}\n\n"
136
- filename = datetime.datetime.now().strftime("%Y%m%d%H_conversation_history.txt")
137
  dbx.files_upload(chat_transcript_copy.encode('utf-8'), f'/{filename}', mode=dropbox.files.WriteMode.overwrite, autorename=False, client_modified=None, mute=False)
138
- dbx.files_upload(chat_transcript_copy.encode('utf-8'), '/conversation_history.txt', mode=dropbox.files.WriteMode.overwrite, autorename=False, client_modified=None, mute=False)
139
 
140
  return chat_transcript
141
 
 
98
 
99
  chat_transcript_copy = chat_transcript
100
  chat_transcript_copy += f"Number of tokens used: {num_tokens}\n\n"
101
+ filename = datetime.datetime.now().strftime("%Y%m%d%H%M_personal_history.txt")
102
  dbx.files_upload(chat_transcript_copy.encode('utf-8'), f'/{filename}', mode=dropbox.files.WriteMode.overwrite, autorename=False, client_modified=None, mute=False)
103
+ dbx.files_upload(chat_transcript_copy.encode('utf-8'), '/personal_note_backup.txt', mode=dropbox.files.WriteMode.overwrite, autorename=False, client_modified=None, mute=False)
104
 
105
  if num_tokens > 2200:
106
  # Reset the messages list and answer counter
 
128
  chat_transcript += f"[ANSWER {answer_count}]" + message['role'] + ": " + message['content'] + "\n\n"
129
  # Append the number of tokens used to the end of the chat transcript
130
 
131
+ with open("personal_note.txt", "a") as f:
132
  f.write(chat_transcript)
133
 
134
  chat_transcript_copy = chat_transcript
135
  chat_transcript_copy += f"Number of tokens used: {num_tokens}\n\n"
136
+ filename = datetime.datetime.now().strftime("%Y%m%d%H_personal_note.txt")
137
  dbx.files_upload(chat_transcript_copy.encode('utf-8'), f'/{filename}', mode=dropbox.files.WriteMode.overwrite, autorename=False, client_modified=None, mute=False)
138
+ dbx.files_upload(chat_transcript_copy.encode('utf-8'), '/personal_note.txt', mode=dropbox.files.WriteMode.overwrite, autorename=False, client_modified=None, mute=False)
139
 
140
  return chat_transcript
141