File size: 413 Bytes
5f683b0
 
 
 
e5f8144
 
 
 
 
 
 
 
 
 
 
5f683b0
e5f8144
 
5f683b0
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/usr/bin/env python

import gradio as gr

CHOICES = ["(NONE)", "a", "b", "c"]


def fn(choices):
    print(choices)
    if "(NONE)" in choices:
        return []
    else:
        return choices


with gr.Blocks() as demo:
    checkbox = gr.CheckboxGroup(choices=CHOICES, value=["a", "b", "c"])
    checkbox.change(fn=fn, inputs=checkbox, outputs=checkbox)

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