Spaces:
Runtime error
Runtime error
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() |