Spaces:
Running
Running
Download run.py from gradio/iframe_resizer_main: direct link, hf CLI and curl.
- Browser
- Download file 1.09 kB
-
https://huggingface.co/spaces/gradio/iframe_resizer_main/resolve/main/run.py
- Command line
-
hf download hf://spaces/gradio/iframe_resizer_main/run.py
-
curl -L -o run.py https://huggingface.co/spaces/gradio/iframe_resizer_main/resolve/main/run.py
1.09 kB
| import gradio as gr | |
| import time | |
| import os | |
| from gradio import get_image | |
| def greet(): | |
| gr.Info("Warning in 1 second") | |
| time.sleep(1) | |
| gr.Warning("Error in 1 second") | |
| time.sleep(1) | |
| raise Exception("test") | |
| im = get_image("cheetah.jpg") | |
| with gr.Blocks() as demo: | |
| with gr.Tab("Accordions"): | |
| 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 | |
| """ | |
| ) | |
| with gr.Tab("Images"): | |
| gr.Image(value=im) | |
| gr.Image(value=im) | |
| gr.Image(value=im) | |
| gr.Image(value=im) | |
| gr.Image(value=im) | |
| gr.Image(value=im) | |
| gr.Image(value=im) | |
| gr.Image(value=im) | |
| gr.Image(value=im) | |
| gr.Image(value=im) | |
| gr.Image(value=im) | |
| if __name__ == "__main__": | |
| demo.launch() | |