File size: 603 Bytes
9649d56 baa86c3 ea7f412 1b3c40f 126eb71 ea7f412 170b7ef ea7f412 101543b 9649d56 126eb71 9649d56 126eb71 c7964dd 126eb71 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
import gradio as gr
import os
import json
def get_msg(name, request: gr.Request):
header_origin = str(request.headers)
header_origin = json.loads(header_origin.replace("'", "\""))['origin']
if header_origin == str(os.environ["ORIGIN"]):
return "Working"
return "Sign up on visualstoriesonline.com"
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() |