Antonio49 commited on
Commit
c678721
·
verified ·
1 Parent(s): 16996c7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -13
app.py CHANGED
@@ -1,20 +1,16 @@
1
  import gradio as gr
2
- from gradio_modal import Modal
3
 
4
 
5
- with gr.Blocks() as demo:
6
- gr.Markdown("### Main Page")
7
- gr.Textbox("lorem ipsum " * 1000, lines=10)
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()