Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -18,11 +18,15 @@ llm = HuggingFaceEndpoint(
|
|
18 |
def suggest_recipes(ingredients):
|
19 |
# Create a prompt for the recipe generation
|
20 |
prompt = (
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
|
|
|
|
|
|
|
|
26 |
|
27 |
|
28 |
# Use the HuggingFaceEndpoint model to generate a response
|
|
|
18 |
def suggest_recipes(ingredients):
|
19 |
# Create a prompt for the recipe generation
|
20 |
prompt = (
|
21 |
+
f"You are a professional chef. Please evaluate the provided input: {ingredients}. "
|
22 |
+
f"If the input does not contain valid food ingredients (e.g., it includes non-food items, random text, or questions like 'What should I cook today?'), "
|
23 |
+
f"respond with exactly two lines apologizing for not being able to process the request. "
|
24 |
+
f"Do not provide recipes, suggestions, or any other information in such cases. "
|
25 |
+
f"If the input contains valid food ingredients, suggest exactly 2 recipes. For each recipe, provide: "
|
26 |
+
f"1) A title, 2) Preparation time, and 3) Clear, step-by-step instructions. "
|
27 |
+
f"Do not include the ingredient list in the response."
|
28 |
+
)
|
29 |
+
|
30 |
|
31 |
|
32 |
# Use the HuggingFaceEndpoint model to generate a response
|