test-radio / app.py
abidlabs's picture
abidlabs HF Staff
Update app.py
ee17e72
raw
history blame contribute delete
432 Bytes
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()