File size: 432 Bytes
c3fbc8b
6c03256
c3fbc8b
 
 
 
 
6c03256
c3fbc8b
 
 
 
ee17e72
c3fbc8b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
import gradio as gr

def change_textbox(choice):
    if choice in {"A", "B"}:
        return gr.update(interactive=False, value="not interactive")
    elif choice == "C":
        return gr.update(interactive=True)

with gr.Blocks() as demo:
    radio_button = gr.Radio(["A", "B", "C"], type="value")
    text_box = gr.Textbox()
    radio_button.change(fn=change_textbox, inputs=radio_button, outputs=text_box)

demo.queue().launch()