Update app.py
Browse files
app.py
CHANGED
|
@@ -8,8 +8,8 @@ model = SentenceTransformer(
|
|
| 8 |
|
| 9 |
def launch(source_sentence, sentences):
|
| 10 |
source = model.encode(source_sentence, convert_to_tensor=True)
|
| 11 |
-
references = model.encode([e.strip() for e in sentences.split("
|
| 12 |
-
return util.pytorch_cos_sim(source, references)
|
| 13 |
|
| 14 |
iface = gr.Interface(launch, inputs=["text","text"], outputs="text")
|
| 15 |
iface.launch()
|
|
|
|
| 8 |
|
| 9 |
def launch(source_sentence, sentences):
|
| 10 |
source = model.encode(source_sentence, convert_to_tensor=True)
|
| 11 |
+
references = model.encode([e.strip() for e in sentences.split("|")], convert_to_tensor=True)
|
| 12 |
+
return util.pytorch_cos_sim(source, references).tolist()
|
| 13 |
|
| 14 |
iface = gr.Interface(launch, inputs=["text","text"], outputs="text")
|
| 15 |
iface.launch()
|