File size: 436 Bytes
c3fbc8b
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
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()