irins commited on
Commit
afa6f9a
·
verified ·
1 Parent(s): 0195055

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -60,8 +60,8 @@ def get_recipes(ingredients, max_calories=None, min_protein=None, max_fat=None,
60
  # Extract recipes from the API response
61
  recipes = response.json().get('results', [])
62
  if recipes:
63
- # Format and return the list of recipes
64
- return "\n".join(
65
  [f'<a href="https://spoonacular.com/recipes/{recipe["id"]}" target="_blank">{recipe["title"]}</a>'
66
  for recipe in recipes]
67
  )
@@ -85,7 +85,7 @@ interface = gr.Interface(
85
  gr.Number(label="Maximum fat (g, optional)"),
86
  gr.Number(label="Maximum carbs (g, optional)"),
87
  ],
88
- outputs="html",
89
  title="Estonian Recipe Search",
90
  description="Enter ingredients in Estonian and set optional limits for calories, protein, fat, and carbs to find suitable recipes."
91
  )
 
60
  # Extract recipes from the API response
61
  recipes = response.json().get('results', [])
62
  if recipes:
63
+ # Format and return the list of recipes as HTML links
64
+ return "<br>".join(
65
  [f'<a href="https://spoonacular.com/recipes/{recipe["id"]}" target="_blank">{recipe["title"]}</a>'
66
  for recipe in recipes]
67
  )
 
85
  gr.Number(label="Maximum fat (g, optional)"),
86
  gr.Number(label="Maximum carbs (g, optional)"),
87
  ],
88
+ outputs=gr.HTML(label="Recipes"),
89
  title="Estonian Recipe Search",
90
  description="Enter ingredients in Estonian and set optional limits for calories, protein, fat, and carbs to find suitable recipes."
91
  )