Spaces:
Running
Running
Download components/antd/radio/demos/basic.py from modelscope/modelscope-studio: direct link, hf CLI and curl.
- Browser
- Download file 1.54 kB
-
https://huggingface.co/spaces/modelscope/modelscope-studio/resolve/main/components/antd/radio/demos/basic.py
- Command line
-
hf download hf://spaces/modelscope/modelscope-studio/components/antd/radio/demos/basic.py
-
curl -L -o basic.py https://huggingface.co/spaces/modelscope/modelscope-studio/resolve/main/components/antd/radio/demos/basic.py
1.54 kB
| import gradio as gr | |
| import modelscope_studio.components.antd as antd | |
| import modelscope_studio.components.base as ms | |
| with gr.Blocks() as demo: | |
| with ms.Application(): | |
| with antd.ConfigProvider(): | |
| with antd.Radio(): | |
| ms.Text("Radio") | |
| antd.Divider("Radio Group") | |
| with antd.Radio.Group(): | |
| with antd.Radio(group_value=1): | |
| ms.Text("A") | |
| with antd.Radio(group_value=2): | |
| ms.Text("B") | |
| with antd.Radio(group_value=3): | |
| ms.Text("C") | |
| with antd.Radio(group_value=4): | |
| ms.Text("D") | |
| antd.Divider("Configuring Options") | |
| antd.Radio.Group(option_type="button", | |
| button_style="solid", | |
| options=[ | |
| { | |
| "label": 'Apple', | |
| "value": 'Apple' | |
| }, | |
| { | |
| "label": 'Pear', | |
| "value": 'Pear' | |
| }, | |
| { | |
| "label": 'Orange', | |
| "value": 'Orange', | |
| "disabled": True | |
| }, | |
| ]) | |
| if __name__ == "__main__": | |
| demo.queue().launch() | |