Spaces:
Build error
Build error
Update Gradio_UI.py
Browse files- Gradio_UI.py +14 -0
Gradio_UI.py
CHANGED
|
@@ -262,6 +262,7 @@ class GradioUI:
|
|
| 262 |
import gradio as gr
|
| 263 |
|
| 264 |
with gr.Blocks(fill_height=True) as demo:
|
|
|
|
| 265 |
stored_messages = gr.State([])
|
| 266 |
file_uploads_log = gr.State([])
|
| 267 |
chatbot = gr.Chatbot(
|
|
@@ -274,6 +275,16 @@ class GradioUI:
|
|
| 274 |
resizeable=True,
|
| 275 |
scale=1,
|
| 276 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 277 |
# If an upload folder is provided, enable the upload feature
|
| 278 |
if self.file_upload_folder is not None:
|
| 279 |
upload_file = gr.File(label="Upload a file")
|
|
@@ -290,6 +301,9 @@ class GradioUI:
|
|
| 290 |
[stored_messages, text_input],
|
| 291 |
).then(self.interact_with_agent, [stored_messages, chatbot], [chatbot])
|
| 292 |
|
|
|
|
|
|
|
|
|
|
| 293 |
demo.launch(debug=True, share=True, **kwargs)
|
| 294 |
|
| 295 |
|
|
|
|
| 262 |
import gradio as gr
|
| 263 |
|
| 264 |
with gr.Blocks(fill_height=True) as demo:
|
| 265 |
+
|
| 266 |
stored_messages = gr.State([])
|
| 267 |
file_uploads_log = gr.State([])
|
| 268 |
chatbot = gr.Chatbot(
|
|
|
|
| 275 |
resizeable=True,
|
| 276 |
scale=1,
|
| 277 |
)
|
| 278 |
+
|
| 279 |
+
# Добавляем dad jokes UI внутрь блока
|
| 280 |
+
input_box = gr.Textbox(label="Enter a word") #added
|
| 281 |
+
output_text = gr.Textbox(label="Jokes Found") #added
|
| 282 |
+
output_audio = gr.Audio(label="Audio Pronunciation", type="filepath") #added
|
| 283 |
+
btn = gr.Button("Get Jokes") #added
|
| 284 |
+
btn.click(gradio_search_jokes, inputs=input_box, outputs=[output_text, output_audio]) #added
|
| 285 |
+
|
| 286 |
+
|
| 287 |
+
|
| 288 |
# If an upload folder is provided, enable the upload feature
|
| 289 |
if self.file_upload_folder is not None:
|
| 290 |
upload_file = gr.File(label="Upload a file")
|
|
|
|
| 301 |
[stored_messages, text_input],
|
| 302 |
).then(self.interact_with_agent, [stored_messages, chatbot], [chatbot])
|
| 303 |
|
| 304 |
+
|
| 305 |
+
|
| 306 |
+
|
| 307 |
demo.launch(debug=True, share=True, **kwargs)
|
| 308 |
|
| 309 |
|