Upload folder using huggingface_hub
Browse files
chat.py
CHANGED
|
@@ -18,7 +18,7 @@ for a in assistants:
|
|
| 18 |
client.beta.assistants.delete(a.id)
|
| 19 |
|
| 20 |
instruction = codecs.open("instruction.txt", "r", "utf-8").read()
|
| 21 |
-
|
| 22 |
model = "gpt-4o"
|
| 23 |
model = "gpt-3.5-turbo"
|
| 24 |
assistant = client.beta.assistants.create(name="Patient Sim", instructions=instruction, model=model)
|
|
@@ -95,7 +95,7 @@ with gr.Blocks(title="Paitient Sim", css=css) as demo:
|
|
| 95 |
audio_html = gr.HTML(visible=False, elem_id="player")
|
| 96 |
msg.submit(user, [msg, mic, chatbot, thread], [msg, chatbot]).then(
|
| 97 |
bot, [chatbot, thread], chatbot).then(
|
| 98 |
-
speak, chatbot, audio_html
|
| 99 |
)
|
| 100 |
mic.stop_recording(user, [msg, mic, chatbot, thread], [msg, chatbot]).then(
|
| 101 |
lambda:None, None, mic).then(
|
|
|
|
| 18 |
client.beta.assistants.delete(a.id)
|
| 19 |
|
| 20 |
instruction = codecs.open("instruction.txt", "r", "utf-8").read()
|
| 21 |
+
instruction = "You are helpful assistant. Keep your responses clear and concise."
|
| 22 |
model = "gpt-4o"
|
| 23 |
model = "gpt-3.5-turbo"
|
| 24 |
assistant = client.beta.assistants.create(name="Patient Sim", instructions=instruction, model=model)
|
|
|
|
| 95 |
audio_html = gr.HTML(visible=False, elem_id="player")
|
| 96 |
msg.submit(user, [msg, mic, chatbot, thread], [msg, chatbot]).then(
|
| 97 |
bot, [chatbot, thread], chatbot).then(
|
| 98 |
+
speak, chatbot, audio_html, js=play_js
|
| 99 |
)
|
| 100 |
mic.stop_recording(user, [msg, mic, chatbot, thread], [msg, chatbot]).then(
|
| 101 |
lambda:None, None, mic).then(
|