File size: 608 Bytes
01f9487
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import gradio as gr
import time


def greet():
    gr.Info("Warning in 1 second")
    time.sleep(1)
    gr.Warning("Error in 1 second")
    time.sleep(1)
    raise Exception("test")


with gr.Blocks() as demo:
    with gr.Row(height=1500):
        gr.Markdown("Scroll down to see UI.")
    greet_btn = gr.Button("Trigger toast")
    greet_btn.click(fn=greet)

    with gr.Accordion("Accordion"):
        gr.Markdown(
            """
## Accordion content
### Accordion content
#### Accordion content
##### Accordion content
###### Accordion content
 """
        )

if __name__ == "__main__":
    demo.launch()