Upload folder using huggingface_hub
Browse files
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,
|