Update app.py
Browse files
app.py
CHANGED
|
@@ -1,15 +1,20 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
-
import
|
| 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 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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()
|