Spaces:
Sleeping
Sleeping
ASG Models
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -183,7 +183,7 @@ def chatbot_fn(input_text, input_audio):
|
|
183 |
# response_text = model.generate_response(input_text, chat_history)
|
184 |
# response_audio = convert_text_to_speech(response_text)
|
185 |
|
186 |
-
chat_history.append((
|
187 |
|
188 |
return chat_history
|
189 |
with gr.Blocks() as demo: # Use gr.Blocks to wrap the entire interface
|
@@ -193,8 +193,10 @@ with gr.Blocks() as demo: # Use gr.Blocks to wrap the entire interface
|
|
193 |
with gr.Row():
|
194 |
txt = gr.Textbox(label="أدخل رسالتك")
|
195 |
audio = gr.Audio(sources="microphone", type="filepath")
|
196 |
-
|
197 |
-
|
|
|
|
|
198 |
|
199 |
with gr.Tab("Chat AI "):
|
200 |
gr.Markdown("## AI: محادثة صوتية بالذكاء الاصطناعي باللهجة السعودية")
|
|
|
183 |
# response_text = model.generate_response(input_text, chat_history)
|
184 |
# response_audio = convert_text_to_speech(response_text)
|
185 |
|
186 |
+
chat_history.append((response_text, response_audio)) # إضافة رد البوت
|
187 |
|
188 |
return chat_history
|
189 |
with gr.Blocks() as demo: # Use gr.Blocks to wrap the entire interface
|
|
|
193 |
with gr.Row():
|
194 |
txt = gr.Textbox(label="أدخل رسالتك")
|
195 |
audio = gr.Audio(sources="microphone", type="filepath")
|
196 |
+
btn_ai_submit = gr.Button("submit")
|
197 |
+
|
198 |
+
btn_ai_submit.click(chatbot_fn, [txt, audio], chatbot)
|
199 |
+
# audio.change(chatbot_fn, [txt, audio], chatbot)
|
200 |
|
201 |
with gr.Tab("Chat AI "):
|
202 |
gr.Markdown("## AI: محادثة صوتية بالذكاء الاصطناعي باللهجة السعودية")
|