File size: 413 Bytes
b8b0688 13ab90d b8b0688 13ab90d b8b0688 |
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()
|