Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -43,8 +43,8 @@ def get_similarity(target,candidates):
|
|
| 43 |
def search(new_query):
|
| 44 |
# Get embeddings of the new query
|
| 45 |
new_query_embeds = get_embeddings([new_query])[0]
|
| 46 |
-
|
| 47 |
-
returned_listings = [ df.iloc[i[0]].to_json() for i in
|
| 48 |
return returned_listings
|
| 49 |
|
| 50 |
|
|
|
|
| 43 |
def search(new_query):
|
| 44 |
# Get embeddings of the new query
|
| 45 |
new_query_embeds = get_embeddings([new_query])[0]
|
| 46 |
+
top_2_recommendations = list(get_similarity(new_query_embeds, df.query_embeds.tolist()))[:2]
|
| 47 |
+
returned_listings = [ df.iloc[i[0]].to_json() for i in top_2_recommendations ]
|
| 48 |
return returned_listings
|
| 49 |
|
| 50 |
|