abidlabs HF Staff commited on
Commit
c3fbc8b
·
1 Parent(s): 1325461

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -0
app.py ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ def change_textbox(choice):
3
+ if choice in {"A", "B"}:
4
+ return gr.update(interactive=False, value="not interactive")
5
+ elif choice == "C":
6
+ return gr.update(interactive=True)
7
+  
8
+ with gr.Blocks() as demo:
9
+ radio_button = gr.Radio(["A", "B", "C"], type="value")
10
+ text_box = gr.Textbox()
11
+ radio_button.change(fn=change_textbox, inputs=radio_button, outputs=text_box)
12
+  
13
+ demo.queue().launch()