File size: 579 Bytes
158f068 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
import gradio as gr
import os
USER = os.environ["USER"]
PASSWORD = os.environ["PASSWORD"]
def get_msg(name):
return "Hello " + name + "!"
def verify_auth(username, password):
if username == USER and password == PASSWORD:
return True
else:
return False
with gr.Blocks() as demo:
input = gr.Textbox(label="Prompt", elem_id="textbox")
output = gr.Textbox(label="Output", elem_id="textbox")
button = gr.Button(value="Make Magic", elem_id="button")
button.click(get_msg, inputs=[input], outputs=[output])
demo.launch(auth=verify_auth) |