Spaces:
Runtime error
Runtime error
Create app.py
Browse files
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()
|