Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -37,5 +37,16 @@ def translate(text):
|
|
| 37 |
z_t5 = encoder_t5(t5_emb)
|
| 38 |
return f"Cosine Similarity: {torch.cosine_similarity(z_bert, z_t5).item():.4f}"
|
| 39 |
|
| 40 |
-
|
| 41 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 37 |
z_t5 = encoder_t5(t5_emb)
|
| 38 |
return f"Cosine Similarity: {torch.cosine_similarity(z_bert, z_t5).item():.4f}"
|
| 39 |
|
| 40 |
+
# Build Gradio UI
|
| 41 |
+
with gr.Blocks(title="Sheri Dee's Universal Geometry Translator") as demo:
|
| 42 |
+
gr.Markdown("## 🌐 Sheri Dee's Universal Geometry Translator")
|
| 43 |
+
gr.Markdown("*Find the hidden connections between worlds of language.*")
|
| 44 |
+
|
| 45 |
+
with gr.Row():
|
| 46 |
+
text_input = gr.Textbox(label="Enter your text here:")
|
| 47 |
+
output = gr.Textbox(label="Cosine Similarity Score")
|
| 48 |
+
|
| 49 |
+
translate_button = gr.Button("🔍 Analyze")
|
| 50 |
+
translate_button.click(fn=translate, inputs=text_input, outputs=output)
|
| 51 |
+
|
| 52 |
+
demo.launch()
|