Twelve2five commited on
Commit
dcc612f
·
verified ·
1 Parent(s): 3e10283

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +19 -19
app.py CHANGED
@@ -75,25 +75,25 @@ def response(
75
 
76
  yield AdditionalOutputs(chatbot)
77
 
78
- # Create a custom UI with Blocks for better rendering
79
- with gr.Blocks(theme=gr.themes.Default()) as custom_ui:
80
- gr.Markdown("# LLM Voice Chat (Powered by DeepSeek & ElevenLabs)")
81
- gr.Markdown("Speak after clicking the microphone button below. Your conversation will appear in the chat.")
82
-
83
- with gr.Row():
84
- chatbot = gr.Chatbot(
85
- value=[],
86
- height=500,
87
- show_label=False,
88
- type="messages",
89
- elem_id="chatbot"
90
- )
91
-
92
- # The mic_placeholder will be replaced by FastRTC with the audio controls
93
- with gr.Row():
94
- mic_placeholder = gr.Markdown("## Voice Controls Will Appear Here")
95
 
96
- # Create Stream with the custom UI
97
  stream = Stream(
98
  modality="audio",
99
  mode="send-receive",
@@ -101,7 +101,7 @@ stream = Stream(
101
  additional_outputs_handler=lambda a, b: b,
102
  additional_inputs=[chatbot],
103
  additional_outputs=[chatbot],
104
- ui=custom_ui, # Use our custom UI instead of ui_args
105
  rtc_configuration=rtc_config
106
  )
107
 
 
75
 
76
  yield AdditionalOutputs(chatbot)
77
 
78
+ # Create Gradio interface
79
+ chatbot = gr.Chatbot(type="messages", height=500, label="Conversation")
80
+
81
+ # Define enhanced UI arguments
82
+ enhanced_ui_args = {
83
+ "title": "LLM Voice Chat (Powered by DeepSeek & ElevenLabs)",
84
+ "description": "Speak after clicking the microphone button below. Your conversation will appear in the chat.",
85
+ "theme": gr.themes.Soft(),
86
+ "css": """
87
+ .gradio-container {
88
+ min-height: 600px;
89
+ }
90
+ #chatbot {
91
+ min-height: 400px;
92
+ }
93
+ """
94
+ }
95
 
96
+ # Create Stream with enhanced UI args and the RTC configuration
97
  stream = Stream(
98
  modality="audio",
99
  mode="send-receive",
 
101
  additional_outputs_handler=lambda a, b: b,
102
  additional_inputs=[chatbot],
103
  additional_outputs=[chatbot],
104
+ ui_args=enhanced_ui_args,
105
  rtc_configuration=rtc_config
106
  )
107