Spaces:
Sleeping
Sleeping
First commit
Browse files
app.py
ADDED
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
|
3 |
+
def greet(name):
|
4 |
+
return "Hello " + name + "!!"
|
5 |
+
|
6 |
+
textbox = gr.Textbox(
|
7 |
+
placeholder="secret", label="Secret", show_label=True, visible=False
|
8 |
+
)
|
9 |
+
def enable_second_task(secret):
|
10 |
+
if secret == "lol":
|
11 |
+
return gr.Textbox.update(visible=True)
|
12 |
+
return gr.Textbox.update(visible=False)
|
13 |
+
|
14 |
+
submit_button = gr.Button("Submit")
|
15 |
+
submit_button.click(lambda secret: secret == "lol", textbox, textbox)
|
16 |
+
|
17 |
+
|
18 |
+
iface = gr.Interface(fn=greet, inputs=[textbox], outputs="text")
|
19 |
+
iface.launch()
|