test-radio / app.py
abidlabs's picture
abidlabs HF Staff
Create app.py
c3fbc8b
raw
history blame
436 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()