chibop commited on
Commit
0b1c230
·
verified ·
1 Parent(s): 20a13a6

Upload folder using huggingface_hub

Browse files
Files changed (1) hide show
  1. chat.py +2 -0
chat.py CHANGED
@@ -30,6 +30,7 @@ def start_thread():
30
  def user(text, audio, history, thread):
31
  if audio:
32
  text = transcribe(audio)
 
33
  message = client.beta.threads.messages.create(thread_id=thread.id, role="user", content=text)
34
  return "", history + [[text, None]]
35
 
@@ -44,6 +45,7 @@ def bot(history, thread):
44
  except: pass
45
 
46
  def transcribe(file):
 
47
  file = open(file, "rb")
48
  response = client.audio.transcriptions.create(
49
  file=file,
 
30
  def user(text, audio, history, thread):
31
  if audio:
32
  text = transcribe(audio)
33
+ print("Message:", text)
34
  message = client.beta.threads.messages.create(thread_id=thread.id, role="user", content=text)
35
  return "", history + [[text, None]]
36
 
 
45
  except: pass
46
 
47
  def transcribe(file):
48
+ print("Transcribe:", file)
49
  file = open(file, "rb")
50
  response = client.audio.transcriptions.create(
51
  file=file,