Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -18,12 +18,11 @@ 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 |
-
# Wrap the prompt in a HumanMessage object
|
27 |
|
28 |
# Use the HuggingFaceEndpoint model to generate a response
|
29 |
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. If any of the following ingredients are invalid or unrecognizable, "
|
22 |
+
f"write a soft two-line apology for not being able to provide recipes using: {ingredients}. "
|
23 |
+
f"Otherwise, please suggest 2 recipes using the valid ingredients. Provide a title for each recipe, "
|
24 |
+
f"include preparation time, and list step-by-step directions. Do not include the ingredients list in the response."
|
25 |
)
|
|
|
26 |
|
27 |
# Use the HuggingFaceEndpoint model to generate a response
|
28 |
response = llm(prompt)
|