File size: 494 Bytes
cc5f090
 
 
 
 
 
 
 
 
 
 
 
 
 
e26ca46
cc5f090
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import gradio as gr

def greet(name):
    return "Hello " + name + "!!"

textbox = gr.Textbox(
    placeholder="secret", label="Secret", show_label=True, visible=False
)
def enable_second_task(secret):
    if secret == "lol":
        return gr.Textbox.update(visible=True)
    return gr.Textbox.update(visible=False)

submit_button = gr.Button("Submit")
submit_button.click(enable_second_task, textbox, textbox)


iface = gr.Interface(fn=greet, inputs=[textbox], outputs="text")
iface.launch()