File size: 935 Bytes
7e31d46
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import gradio as gr
import os

def compare_text(source, target):
  return f"{os.environ.get('ORGANIZATION')} > {os.environ.get('API_KEY')}"

with gr.Blocks(css=".gradio-container { background-color: white; background-image: url('file=https://res.cloudinary.com/crunchbase-production/image/upload/c_lpad,h_256,w_256,f_auto,q_auto:eco,dpr_1/v1448402436/lwt1fdq69mdwal1jk894.png'); background-size: 100px 100px; background-repeat: no-repeat; background-position: 0px 0px; }") as demo:
    gr.Markdown("# Text comparer")
    with gr.Row():
        source = gr.Textbox(lines=3, label="Text to be compared", placeholder="Source text")
    with gr.Row():
        target = gr.Textbox(lines=3, label="Target phrases", placeholder="Target text")
    btn = gr.Button(value="Compare!", variant="primary")
    with gr.Row():
        label = gr.Label()
    btn.click(fn=compare_text, inputs=[source,target], outputs=[label])

demo.launch(debug=True)