pratikshahp commited on
Commit
75b990e
·
verified ·
1 Parent(s): 3a8a62c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -28,7 +28,8 @@ def validate_ingredients(ingredients):
28
  def generate_recipe(ingredients):
29
  prompt = (
30
  f"You are an expert chef. Using the ingredients: {ingredients}, "
31
- f"suggest exactly one recipe. Provide a title, preparation time, and step-by-step instructions. "
 
32
  f"Do not include the ingredient list explicitly in the response."
33
  )
34
  response = llm(prompt)
@@ -40,7 +41,7 @@ def suggest_recipes(ingredients):
40
  if validation_result == "Valid":
41
  return generate_recipe(ingredients)
42
  else:
43
- return "I'm sorry, but I can't process this request due to invalid ingredients."
44
 
45
  # Gradio interface
46
  with gr.Blocks() as app:
 
28
  def generate_recipe(ingredients):
29
  prompt = (
30
  f"You are an expert chef. Using the ingredients: {ingredients}, "
31
+ f"suggest two recipes. Provide a title, preparation time, and step-by-step instructions. "
32
+ f"It is not mandatory to include all ingredients, pick the ingredients required for each recipe. "
33
  f"Do not include the ingredient list explicitly in the response."
34
  )
35
  response = llm(prompt)
 
41
  if validation_result == "Valid":
42
  return generate_recipe(ingredients)
43
  else:
44
+ return "I'm sorry, but I can't process this request due to invalid ingredients. Please provide valid ingredients for cooking!"
45
 
46
  # Gradio interface
47
  with gr.Blocks() as app: