Spaces:
Runtime error
Runtime error
Commit
·
7e31d46
1
Parent(s):
019c4e3
Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
import os
|
3 |
+
|
4 |
+
def compare_text(source, target):
|
5 |
+
return f"{os.environ.get('ORGANIZATION')} > {os.environ.get('API_KEY')}"
|
6 |
+
|
7 |
+
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:
|
8 |
+
gr.Markdown("# Text comparer")
|
9 |
+
with gr.Row():
|
10 |
+
source = gr.Textbox(lines=3, label="Text to be compared", placeholder="Source text")
|
11 |
+
with gr.Row():
|
12 |
+
target = gr.Textbox(lines=3, label="Target phrases", placeholder="Target text")
|
13 |
+
btn = gr.Button(value="Compare!", variant="primary")
|
14 |
+
with gr.Row():
|
15 |
+
label = gr.Label()
|
16 |
+
btn.click(fn=compare_text, inputs=[source,target], outputs=[label])
|
17 |
+
[source, target],
|
18 |
+
fn=compare_text
|
19 |
+
)
|
20 |
+
|
21 |
+
demo.launch(debug=True)
|