Spaces:
Sleeping
Sleeping
Commit
·
abb873f
1
Parent(s):
52ef36d
Update app.py
Browse files
app.py
CHANGED
@@ -648,7 +648,7 @@ async def recipes_endpoint(profile: MedicalProfile):
|
|
648 |
# Load embeddings and retrieve initial results
|
649 |
embeddings_data = load_embeddings()
|
650 |
folder_path = 'downloaded_articles/downloaded_articles'
|
651 |
-
initial_results = query_embeddings(query_embedding, embeddings_data, n_results=
|
652 |
if not initial_results:
|
653 |
raise ValueError("No relevant recipes found.")
|
654 |
|
@@ -689,7 +689,7 @@ async def recipes_endpoint(profile: MedicalProfile):
|
|
689 |
})
|
690 |
|
691 |
# Limit the response to top 5 recipes
|
692 |
-
return {"recipes": recipes[:
|
693 |
|
694 |
except ValueError as ve:
|
695 |
# Handle expected errors
|
|
|
648 |
# Load embeddings and retrieve initial results
|
649 |
embeddings_data = load_embeddings()
|
650 |
folder_path = 'downloaded_articles/downloaded_articles'
|
651 |
+
initial_results = query_embeddings(query_embedding, embeddings_data, n_results=10)
|
652 |
if not initial_results:
|
653 |
raise ValueError("No relevant recipes found.")
|
654 |
|
|
|
689 |
})
|
690 |
|
691 |
# Limit the response to top 5 recipes
|
692 |
+
return {"recipes": recipes[:10], "success": True}
|
693 |
|
694 |
except ValueError as ve:
|
695 |
# Handle expected errors
|