Spaces:
Sleeping
Sleeping
Bhushan4829
commited on
Commit
·
ca7c7e1
1
Parent(s):
0b90102
Code Updated
Browse files- semantic_search.py +1 -1
semantic_search.py
CHANGED
|
@@ -25,7 +25,7 @@ class EnhancedSemanticSearchEvaluator:
|
|
| 25 |
def compute_similarity(self, model, query, matches):
|
| 26 |
query_embedding = model.encode(query, convert_to_tensor=True)
|
| 27 |
match_embeddings = model.encode(
|
| 28 |
-
[
|
| 29 |
)
|
| 30 |
scores = util.pytorch_cos_sim(query_embedding, match_embeddings).squeeze(0).tolist()
|
| 31 |
return scores
|
|
|
|
| 25 |
def compute_similarity(self, model, query, matches):
|
| 26 |
query_embedding = model.encode(query, convert_to_tensor=True)
|
| 27 |
match_embeddings = model.encode(
|
| 28 |
+
[match['metadata'] for match in matches], convert_to_tensor=True
|
| 29 |
)
|
| 30 |
scores = util.pytorch_cos_sim(query_embedding, match_embeddings).squeeze(0).tolist()
|
| 31 |
return scores
|