pratikshahp commited on
Commit
a27f318
·
verified ·
1 Parent(s): 160cf0a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -4
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. 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} and please do not suggest any recipe. "
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)
 
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)