Spaces:
Runtime error
Runtime error
Commit
·
0ed9063
1
Parent(s):
0347c50
Minor UI changes
Browse files
app.py
CHANGED
@@ -151,31 +151,33 @@ with gr.Blocks(title='Talk to chatGPT') as demo:
|
|
151 |
with gr.Group(elem_id="page_2", visible=False) as page_2:
|
152 |
with gr.Row(elem_id="chat_row"):
|
153 |
chatbot = gr.Chatbot(elem_id="chat_bot", visible=False).style(color_map=("green", "blue"))
|
154 |
-
chatbot1 = gr.Chatbot(elem_id="chat_bot1").style(color_map=("green", "blue"))
|
155 |
-
with gr.Row(
|
156 |
-
|
157 |
-
chat_history = gr.Textbox(lines=4, label="prompt", visible=False)
|
158 |
-
with gr.Column():
|
159 |
-
prompt_input_audio = gr.Audio(
|
160 |
source="microphone",
|
161 |
type="filepath",
|
162 |
label="Record Audio Input",
|
163 |
|
164 |
)
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
)
|
171 |
-
|
172 |
submit_btn = gr.Button(value = "Submit",elem_id="submit-btn").style(
|
173 |
margin=True,
|
174 |
rounded=(True, True, True, True),
|
175 |
width=100
|
176 |
)
|
177 |
|
178 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
179 |
inputs=[prompt_input, chat_history],
|
180 |
outputs=[chatbot, chat_history],
|
181 |
)
|
|
|
151 |
with gr.Group(elem_id="page_2", visible=False) as page_2:
|
152 |
with gr.Row(elem_id="chat_row"):
|
153 |
chatbot = gr.Chatbot(elem_id="chat_bot", visible=False).style(color_map=("green", "blue"))
|
154 |
+
chatbot1 = gr.Chatbot(elem_id="chat_bot1").style(color_map=("green", "blue"))
|
155 |
+
with gr.Row():
|
156 |
+
prompt_input_audio = gr.Audio(
|
|
|
|
|
|
|
157 |
source="microphone",
|
158 |
type="filepath",
|
159 |
label="Record Audio Input",
|
160 |
|
161 |
)
|
162 |
+
translate_btn = gr.Button("Check Whisper first ? 👍")
|
163 |
+
|
164 |
+
with gr.Row(elem_id="prompt_row"):
|
165 |
+
prompt_input = gr.Textbox(lines=2, label="Input text (translated)",show_label=True)
|
166 |
+
chat_history = gr.Textbox(lines=4, label="prompt", visible=False)
|
|
|
|
|
167 |
submit_btn = gr.Button(value = "Submit",elem_id="submit-btn").style(
|
168 |
margin=True,
|
169 |
rounded=(True, True, True, True),
|
170 |
width=100
|
171 |
)
|
172 |
|
173 |
+
|
174 |
+
|
175 |
+
translate_btn.click(fn=translate,
|
176 |
+
inputs=prompt_input_audio,
|
177 |
+
outputs=prompt_input
|
178 |
+
)
|
179 |
+
|
180 |
+
submit_btn.click(fn=chat,
|
181 |
inputs=[prompt_input, chat_history],
|
182 |
outputs=[chatbot, chat_history],
|
183 |
)
|