Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,8 +1,7 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
from sentence_transformers import SentenceTransformer, util
|
| 3 |
|
| 4 |
-
|
| 5 |
-
model = SentenceTransformer("intfloat/multilingual-e5-large-instruct")
|
| 6 |
|
| 7 |
def compute_similarity(text1, text2):
|
| 8 |
if not text1.strip() or not text2.strip():
|
|
@@ -24,13 +23,11 @@ def compute_similarity(text1, text2):
|
|
| 24 |
"message": "Success"
|
| 25 |
}
|
| 26 |
|
| 27 |
-
# Gradio API Interface
|
| 28 |
iface = gr.Interface(
|
| 29 |
fn=compute_similarity,
|
| 30 |
inputs=[gr.Textbox(lines=5), gr.Textbox(lines=5)],
|
| 31 |
outputs="json",
|
| 32 |
-
title="Writenix Similarity Engine"
|
| 33 |
-
allow_flagging="never"
|
| 34 |
)
|
| 35 |
|
| 36 |
iface.launch()
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
from sentence_transformers import SentenceTransformer, util
|
| 3 |
|
| 4 |
+
model = SentenceTransformer("sentence-transformers/all-MiniLM-L6-v2")
|
|
|
|
| 5 |
|
| 6 |
def compute_similarity(text1, text2):
|
| 7 |
if not text1.strip() or not text2.strip():
|
|
|
|
| 23 |
"message": "Success"
|
| 24 |
}
|
| 25 |
|
|
|
|
| 26 |
iface = gr.Interface(
|
| 27 |
fn=compute_similarity,
|
| 28 |
inputs=[gr.Textbox(lines=5), gr.Textbox(lines=5)],
|
| 29 |
outputs="json",
|
| 30 |
+
title="Writenix Similarity Engine"
|
|
|
|
| 31 |
)
|
| 32 |
|
| 33 |
iface.launch()
|