GreenRaptor commited on
Commit
07e0994
·
1 Parent(s): 1b44681

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -21
app.py CHANGED
@@ -70,35 +70,22 @@ with gr.Blocks(css=css) as demo:
70
 
71
  with gr.Box():
72
 
73
- # chatbot = gr.Chatbot()
74
- # msg = gr.Textbox()
75
  chatbot = gr.Chatbot([], show_label=False, elem_id="chatbot").style(height="auto")
76
 
77
- # with gr.Row():
78
  with gr.Row(elem_id="prompt-container").style(mobile_collapse=False, equal_height=True):
79
- with gr.Column(scale=0.70):
80
  txt = gr.Textbox(
81
  show_label=False,
82
- placeholder="Type your response and press enter, or record your response",
83
  ).style(container=False)
84
  with gr.Column(scale=0.15, min_width=0):
85
- record = gr.Audio(source="microphone", type="filepath", show_label=False)
86
- with gr.Column(scale=0.15, min_width=0):
87
- speech = gr.Button("Submit")
88
 
89
- # gr.Interface(
90
- # fn=transcribe,
91
- # inputs=[
92
- # gr.Audio(source="microphone", type="filepath", streaming=True),
93
- # "state"
94
- # ],
95
- # outputs=[
96
- # msg,
97
- # "state"
98
- # ],
99
- # live=True)
100
-
101
- send = gr.Button("Send")
102
 
103
  speech.click(transcribe, inputs=record, outputs=txt)
104
  txt.submit(user, [txt, chatbot], [txt, chatbot], queue=False).then(
 
70
 
71
  with gr.Box():
72
 
 
 
73
  chatbot = gr.Chatbot([], show_label=False, elem_id="chatbot").style(height="auto")
74
 
 
75
  with gr.Row(elem_id="prompt-container").style(mobile_collapse=False, equal_height=True):
76
+ with gr.Column(scale=0.85):
77
  txt = gr.Textbox(
78
  show_label=False,
79
+ placeholder="Type and press enter, or record your response...",
80
  ).style(container=False)
81
  with gr.Column(scale=0.15, min_width=0):
82
+ send = gr.Button("Send")
 
 
83
 
84
+ with gr.Row(elem_id="audio-container").style(mobile_collapse=False, equal_height=True):
85
+ with gr.Column(scale=0.75):
86
+ record = gr.Audio(source="microphone", type="filepath", show_label=False).style(container=False)
87
+ with gr.Column(scale=0.25, min_width=0):
88
+ speech = gr.Button("Submit speech")
 
 
 
 
 
 
 
 
89
 
90
  speech.click(transcribe, inputs=record, outputs=txt)
91
  txt.submit(user, [txt, chatbot], [txt, chatbot], queue=False).then(