File size: 485 Bytes
9649d56
1b3c40f
126eb71
 
 
abd5e81
9649d56
126eb71
9649d56
126eb71
 
 
 
c7964dd
126eb71
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import gradio as gr

def get_msg(name, request: gr.Request):
    if dict(request.headers)['origin'] in os.environ["ORIGIN"]:
        return "Working"
    return "Hello " + name + "!" + os.eniron["ORIGIN"]

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()