pratikshahp commited on
Commit
967260e
·
verified ·
1 Parent(s): 5de8988

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -5
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. Please suggest 2 recipes using the following "
22
- f"ingredients: {ingredients}. Provide a title for each recipe, include "
23
- f"preparation time, and list step-by-step directions do not include ingredients list in response."
24
- f"write soft apology in two lines for not valid {ingredients} and do not generate any recipe"
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)