CurryMindFree commited on
Commit
5ceff8d
·
verified ·
1 Parent(s): 164b0b9

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +33 -0
app.py ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+
3
+ def show_textbox():
4
+ return gr.update(visible=True)
5
+
6
+ def func1():
7
+ return "one"
8
+
9
+ def func2():
10
+ return "two"
11
+
12
+ def ui_test(ip):
13
+ one=func1()
14
+ show_textbox()
15
+ if(user_input=="y"):
16
+ return one
17
+ two = func2()
18
+ return two
19
+
20
+
21
+
22
+ demo = gr.Interface(
23
+ fn=ui_test,
24
+ inputs=gr.Textbox(),
25
+ outputs="text",
26
+ user_input = gr.Textbox(
27
+ label="Your input",
28
+ visible=False
29
+ )
30
+
31
+ )
32
+
33
+ demo.launch()