FranklinWillemen commited on
Commit
9e4db90
1 Parent(s): 23830c1

remove bug save context

Browse files
Files changed (1) hide show
  1. discourse.py +2 -3
discourse.py CHANGED
@@ -26,17 +26,16 @@ def gen_voice(response, response_filename):
26
  stream = speechsdk.AudioDataStream(reponse_audio)
27
  stream.save_to_wav_file(response_filename)
28
 
29
- def save_context(context):
30
  chat_transcript = ""
31
  file_name = "context.txt"
32
-
33
  with open(file_name, 'w') as file:
34
  for message in context:
35
  if message['role'] != 'system':
36
  chat_transcript = message['role'] + ": " + message['content'] + "\n\n"
37
  file.write(chat_transcript)
38
 
39
-
40
  def respond(audio:str):
41
  transcript = transcribe("whisper-1", audio)
42
  context.append({"role": "user", "content": transcript['text']})
 
26
  stream = speechsdk.AudioDataStream(reponse_audio)
27
  stream.save_to_wav_file(response_filename)
28
 
29
+ def save_context():
30
  chat_transcript = ""
31
  file_name = "context.txt"
32
+
33
  with open(file_name, 'w') as file:
34
  for message in context:
35
  if message['role'] != 'system':
36
  chat_transcript = message['role'] + ": " + message['content'] + "\n\n"
37
  file.write(chat_transcript)
38
 
 
39
  def respond(audio:str):
40
  transcript = transcribe("whisper-1", audio)
41
  context.append({"role": "user", "content": transcript['text']})