Antonio49 commited on
Commit
06640b6
·
1 Parent(s): 0c83596

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -12
app.py CHANGED
@@ -1,17 +1,17 @@
1
  import gradio as gr
 
2
 
3
- def greet(name):
4
- return "Hello " + name + "!!"
5
 
6
- iface = gr.Interface(fn=greet, inputs="text", outputs="text",
7
- examples=[
8
- ["Hello " + "!!"],
9
- [ "Hello Antonio!!"],
10
- [ "Hello Pedro!!"],
11
- [ "Hello 568Ant!!"],
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
- iface.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, 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
+