Update app.py
Browse files
app.py
CHANGED
|
@@ -1,17 +1,17 @@
|
|
| 1 |
import gradio as gr
|
|
|
|
| 2 |
|
| 3 |
-
def greet(name):
|
| 4 |
-
return "Hello " + name + "!!"
|
| 5 |
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
],
|
| 13 |
-
title="Hola básico",
|
| 14 |
description="Aquí hay un saludo básico.",
|
| 15 |
article= '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'
|
| 16 |
-
)
|
| 17 |
-
|
|
|
|
|
|
|
|
|
|
|
|
| 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, title="Hola básico",
|
|
|
|
|
|
|
| 11 |
description="Aquí hay un saludo básico.",
|
| 12 |
article= '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()
|
| 17 |
+
|