Update app.py
Browse files
app.py
CHANGED
|
@@ -1,20 +1,16 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
-
|
| 3 |
|
| 4 |
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
with Modal(visible=True) as modal:
|
| 10 |
-
gr.Markdown("# License Agreement")
|
| 11 |
-
gr.Textbox(value="This is the license agreement. Please read it carefully. " * 5, lines=12)
|
| 12 |
-
close_btn = gr.Button("Close Modal")
|
| 13 |
-
close_btn.click(lambda: Modal(visible=False), None, modal)
|
| 14 |
-
|
| 15 |
-
show_btn = gr.Button("Show Modal")
|
| 16 |
-
show_btn.click(lambda: Modal(visible=True), None, modal)
|
| 17 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 18 |
|
| 19 |
if __name__ == "__main__":
|
| 20 |
demo.launch()
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
+
import time
|
| 3 |
|
| 4 |
|
| 5 |
+
def slow_echo(message, history):
|
| 6 |
+
for i in range(len(message)):
|
| 7 |
+
time.sleep(0.05)
|
| 8 |
+
yield "Tu escribiste: " + message[: i+1]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
|
| 10 |
+
demo = gr.ChatInterface(slow_echo,
|
| 11 |
+
title="Chat básico",
|
| 12 |
+
description= 'Autor: <a href=\"https://huggingface.co/Antonio49\">Antonio Fernández</a> de <a href=\"https://saturdays.ai/\">SaturdaysAI</a>. Formación: <a href=\"https://cursos.saturdays.ai/courses/\">Cursos Online AI</a> Aplicación desarrollada con fines docentes'
|
| 13 |
+
).queue()
|
| 14 |
|
| 15 |
if __name__ == "__main__":
|
| 16 |
demo.launch()
|