awacke1 commited on
Commit
953bac0
·
1 Parent(s): e355785

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +18 -0
app.py ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+
3
+ def change_textbox(choice):
4
+ if choice == "short":
5
+ return gr.Textbox.update(lines=20, visible=True)
6
+ elif choice == "long":
7
+ return gr.Textbox.update(lines=80, visible=True)
8
+ else:
9
+ return gr.Textbox.update(visible=False)
10
+
11
+ with gr.Blocks() as block:
12
+ radio = gr.Radio(
13
+ ["short", "long", "none"], label="What kind of essay would you like to write?"
14
+ )
15
+ text = gr.Textbox(lines=20, interactive=True)
16
+
17
+ radio.change(fn=change_textbox, inputs=radio, outputs=text)
18
+ block.launch()