Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -18,11 +18,13 @@ llm = HuggingFaceEndpoint(
|
|
18 |
def suggest_recipes(ingredients):
|
19 |
# Create a prompt for the recipe generation
|
20 |
prompt = (
|
21 |
-
f"You are an expert in cooking.
|
22 |
-
f"
|
23 |
-
f"
|
24 |
-
f"
|
|
|
25 |
)
|
|
|
26 |
|
27 |
# Use the HuggingFaceEndpoint model to generate a response
|
28 |
response = llm(prompt)
|
|
|
18 |
def suggest_recipes(ingredients):
|
19 |
# Create a prompt for the recipe generation
|
20 |
prompt = (
|
21 |
+
f"You are an expert in cooking. Please review the following ingredients: {ingredients}. "
|
22 |
+
f"If any ingredient is invalid, such as non-food items or unrecognizable terms, "
|
23 |
+
f"respond only with a polite, two-line apology and do not provide any recipes. "
|
24 |
+
f"If all ingredients are valid, suggest 2 recipes using them. Provide a title for each recipe, include "
|
25 |
+
f"preparation time, and list step-by-step directions. Do not include the ingredients list in the response."
|
26 |
)
|
27 |
+
|
28 |
|
29 |
# Use the HuggingFaceEndpoint model to generate a response
|
30 |
response = llm(prompt)
|