Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -212,15 +212,23 @@ with gr.Blocks(css="""
|
|
| 212 |
background_btn.click(save_background, inputs=[background, user_profile], outputs=[background_output, user_profile])
|
| 213 |
|
| 214 |
# Step 3 - Chatbot Mode Selection
|
| 215 |
-
|
| 216 |
-
|
| 217 |
-
|
| 218 |
-
|
| 219 |
-
|
| 220 |
-
|
| 221 |
-
|
| 222 |
-
|
| 223 |
-
|
| 224 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 225 |
|
| 226 |
demo.launch()
|
|
|
|
| 212 |
background_btn.click(save_background, inputs=[background, user_profile], outputs=[background_output, user_profile])
|
| 213 |
|
| 214 |
# Step 3 - Chatbot Mode Selection
|
| 215 |
+
# Step 3 - Chatbot Mode Selection
|
| 216 |
+
# Step 3 - Chatbot Mode Selection
|
| 217 |
+
gr.Markdown("### Step 3: Choose Chat Mode")
|
| 218 |
+
|
| 219 |
+
with gr.Tabs():
|
| 220 |
+
with gr.Tab("Text Mode"):
|
| 221 |
+
chatbot_text = gr.Chatbot(label="Interview Chat (Text Mode)")
|
| 222 |
+
msg = gr.Textbox(label="Type 'start' to begin")
|
| 223 |
+
send_btn = gr.Button("Send")
|
| 224 |
+
send_btn.click(respond, inputs=[msg, chat_history, user_profile], outputs=[chatbot_text], queue=False)
|
| 225 |
+
send_btn.click(lambda: "", None, msg, queue=False)
|
| 226 |
+
|
| 227 |
+
with gr.Tab("Audio Mode"):
|
| 228 |
+
chatbot_audio = gr.Chatbot(label="Interview Chat (Audio Mode)")
|
| 229 |
+
audio_input = gr.Audio(source="microphone", type="filepath", label="Record Your Answer")
|
| 230 |
+
audio_btn = gr.Button("Send Audio")
|
| 231 |
+
audio_btn.click(handle_audio, inputs=[audio_input, chat_history, user_profile], outputs=[chatbot_audio], queue=False)
|
| 232 |
+
|
| 233 |
|
| 234 |
demo.launch()
|