raz-135 commited on
Commit
0d643bf
·
verified ·
1 Parent(s): de7930c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +28 -6
app.py CHANGED
@@ -33,20 +33,42 @@ def chatbot(audio=None):
33
 
34
  # Create a custom interface
35
  def build_interface():
36
- with gr.Blocks() as demo:
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
37
  gr.Markdown(
38
  """
39
- <h1 style="text-align: center; color: #4CAF50;">Voice-to-Voice</h1>
40
  """
41
  )
42
- with gr.Row():
43
- with gr.Column(scale=1):
44
  audio_input = gr.Audio(type="filepath", label="Record Your Voice")
45
- with gr.Column(scale=2):
46
  chatbot_output_text = gr.Textbox(label="Chatbot Response")
47
  chatbot_output_audio = gr.Audio(label="Audio Response")
48
 
49
- submit_button = gr.Button("Send")
50
 
51
  submit_button.click(
52
  fn=chatbot,
 
33
 
34
  # Create a custom interface
35
  def build_interface():
36
+ with gr.Blocks(css="""
37
+ .block-title {
38
+ text-align: center;
39
+ color: white;
40
+ background-color: #4CAF50;
41
+ padding: 10px;
42
+ border-radius: 8px;
43
+ }
44
+ .gradio-row {
45
+ background-color: #f0f0f0;
46
+ border-radius: 8px;
47
+ padding: 20px;
48
+ margin: 10px;
49
+ }
50
+ .gradio-column {
51
+ padding: 10px;
52
+ }
53
+ .gradio-button {
54
+ background-color: #4CAF50;
55
+ color: white;
56
+ border-radius: 8px;
57
+ }
58
+ """) as demo:
59
  gr.Markdown(
60
  """
61
+ <h1 class="block-title">Voice-to-Voice AI Chatbot</h1>
62
  """
63
  )
64
+ with gr.Row(elem_classes="gradio-row"):
65
+ with gr.Column(elem_classes="gradio-column", scale=1):
66
  audio_input = gr.Audio(type="filepath", label="Record Your Voice")
67
+ with gr.Column(elem_classes="gradio-column", scale=2):
68
  chatbot_output_text = gr.Textbox(label="Chatbot Response")
69
  chatbot_output_audio = gr.Audio(label="Audio Response")
70
 
71
+ submit_button = gr.Button("Send", elem_classes="gradio-button")
72
 
73
  submit_button.click(
74
  fn=chatbot,