Antonio49 commited on
Commit
a6a91bf
·
verified ·
1 Parent(s): 4c17f86

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -9
app.py CHANGED
@@ -1,15 +1,20 @@
1
  import gradio as gr
2
- import time
3
 
4
- def slow_echo(message, history):
5
- for i in range(len(message)):
6
- time.sleep(0.05)
7
- yield "Tu escribiste: " + message[: i+1]
8
 
9
- demo = gr.ChatInterface(slow_echo,
10
- title="Chat básico",
11
- 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'
12
- ).queue()
 
 
 
 
 
 
 
 
 
13
 
14
  if __name__ == "__main__":
15
  demo.launch()
 
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()