maahikachitagi commited on
Commit
16db526
·
verified ·
1 Parent(s): 637a592

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +18 -10
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
- gr.Markdown("### Choose Chat Mode")
216
- with gr.Row():
217
- gr.Button("Text-Based") # You can build voice & webcam later :)
218
-
219
- # Chat interface
220
- chatbot = gr.Chatbot(label="Interview Chat")
221
- msg = gr.Textbox(label="Type 'start' to begin")
222
- send_btn = gr.Button("Send")
223
- send_btn.click(respond, inputs=[msg, chat_history, user_profile], outputs=[chatbot], queue=False)
224
- send_btn.click(lambda: "", None, msg, queue=False)
 
 
 
 
 
 
 
 
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()