m3hrdadfi commited on
Commit
78dcb35
1 Parent(s): 808e522

Fix GenFood

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -41,7 +41,7 @@ def generate_cook_image(query, app_id, app_key):
41
  return None
42
 
43
  data = rj["hits"]
44
- data = data[random.randint(0, min(4, len(data) - 1))] if len(data) > 1 else data[0]
45
 
46
  if "recipe" not in data or "image" not in data["recipe"]:
47
  return None
 
41
  return None
42
 
43
  data = rj["hits"]
44
+ data = data[random.randint(1, min(5, len(data) - 1))] if len(data) > 1 else data[0]
45
 
46
  if "recipe" not in data or "image" not in data["recipe"]:
47
  return None