Update app.py
Browse files
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%
|
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'), '/
|
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("
|
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%
|
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'), '/
|
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 |
|