Spaces:
Runtime error
Runtime error
Nathan Franklin
commited on
Commit
·
63f3aa1
1
Parent(s):
8cf49b6
change message form
Browse files
app.py
CHANGED
|
@@ -30,12 +30,13 @@ def generate_response(
|
|
| 30 |
language=language_codes[language_choice]
|
| 31 |
)
|
| 32 |
user_query_transcribed = list(user_query_transcribed_segments)[0].text.strip()
|
| 33 |
-
user_message = 'User: ' + user_query_transcribed
|
| 34 |
|
| 35 |
# Ask llm for response to text
|
| 36 |
|
| 37 |
-
bot_message = '
|
| 38 |
-
|
|
|
|
|
|
|
| 39 |
|
| 40 |
# Convert llm response to audio
|
| 41 |
# Return None to reset user input audio and
|
|
@@ -71,7 +72,7 @@ with gr.Blocks() as demo:
|
|
| 71 |
value='Flirty Friend'
|
| 72 |
)
|
| 73 |
|
| 74 |
-
chatbot = gr.Chatbot()
|
| 75 |
|
| 76 |
user_input = gr.Audio(
|
| 77 |
sources='microphone',
|
|
|
|
| 30 |
language=language_codes[language_choice]
|
| 31 |
)
|
| 32 |
user_query_transcribed = list(user_query_transcribed_segments)[0].text.strip()
|
|
|
|
| 33 |
|
| 34 |
# Ask llm for response to text
|
| 35 |
|
| 36 |
+
bot_message = 'bot: '+ user_query_transcribed
|
| 37 |
+
|
| 38 |
+
chatbot_history.append(gr.ChatMessage(role="user", content=user_query_transcribed))
|
| 39 |
+
chatbot_history.append(gr.ChatMessage(role="assistant", content=bot_message))
|
| 40 |
|
| 41 |
# Convert llm response to audio
|
| 42 |
# Return None to reset user input audio and
|
|
|
|
| 72 |
value='Flirty Friend'
|
| 73 |
)
|
| 74 |
|
| 75 |
+
chatbot = gr.Chatbot(type='messages')
|
| 76 |
|
| 77 |
user_input = gr.Audio(
|
| 78 |
sources='microphone',
|