Spaces:
Sleeping
Sleeping
Create app.py
Browse files
app.py
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import gradio as gr
|
| 2 |
+
import time
|
| 3 |
+
|
| 4 |
+
|
| 5 |
+
def greet():
|
| 6 |
+
gr.Info("Warning in 1 second")
|
| 7 |
+
time.sleep(1)
|
| 8 |
+
gr.Warning("Error in 1 second")
|
| 9 |
+
time.sleep(1)
|
| 10 |
+
raise Exception("test")
|
| 11 |
+
|
| 12 |
+
|
| 13 |
+
with gr.Blocks() as demo:
|
| 14 |
+
with gr.Row(height=1500):
|
| 15 |
+
gr.Markdown("Scroll down to see UI.")
|
| 16 |
+
greet_btn = gr.Button("Trigger toast")
|
| 17 |
+
greet_btn.click(fn=greet)
|
| 18 |
+
|
| 19 |
+
with gr.Accordion("Accordion"):
|
| 20 |
+
gr.Markdown(
|
| 21 |
+
"""
|
| 22 |
+
## Accordion content
|
| 23 |
+
### Accordion content
|
| 24 |
+
#### Accordion content
|
| 25 |
+
##### Accordion content
|
| 26 |
+
###### Accordion content
|
| 27 |
+
"""
|
| 28 |
+
)
|
| 29 |
+
|
| 30 |
+
if __name__ == "__main__":
|
| 31 |
+
demo.launch()
|