Spaces:
Runtime error
Runtime error
modify output
Browse files
app.py
CHANGED
@@ -23,7 +23,7 @@ if st.button('Generate'):
|
|
23 |
# Instructions: ['In a large skillet over medium-high heat, cook the ground beef until browned. Drain off any excess fat.', 'Add the onion, garlic, bell peppers, and jalapeño to the skillet and cook until softened, about 5 minutes.', 'Stir in the tomato sauce, Worcestershire sauce, soy sauce, brown sugar, red wine vinegar, and olive oil. Season with salt and pepper, to taste.', 'Reduce heat to low and simmer for 10 minutes, stirring occasionally.', 'Serve over cooked rice or noodles.']
|
24 |
# Image of final dish: ['The final dish is a savory and flavorful beef stir-fry. The beef is cooked with onions, garlic, bell peppers, and jalapeño, and then simmered in a mixture of tomato sauce, Worcestershire sauce, soy sauce, brown sugar, red wine vinegar, and olive oil. The stir-fry is served over cooked rice or noodles.']
|
25 |
# Estimated calories in number: [500, 600]
|
26 |
-
# Healthiness score out of
|
27 |
# Estimated percentage of food categories: {'Vegetables': 40, 'Whole grains': 0, 'Healthy protein': 30, 'Fruits': 0, 'Healthy oils': 10}
|
28 |
# '''
|
29 |
print(response)
|
@@ -48,7 +48,7 @@ if st.button('Generate'):
|
|
48 |
else:
|
49 |
print("Wrong calories output")
|
50 |
est_cal = est_cal[0]
|
51 |
-
healthiness = literal_eval(re.findall('Healthiness score out of
|
52 |
try:
|
53 |
healthiness = healthiness[0]
|
54 |
except:
|
|
|
23 |
# Instructions: ['In a large skillet over medium-high heat, cook the ground beef until browned. Drain off any excess fat.', 'Add the onion, garlic, bell peppers, and jalapeño to the skillet and cook until softened, about 5 minutes.', 'Stir in the tomato sauce, Worcestershire sauce, soy sauce, brown sugar, red wine vinegar, and olive oil. Season with salt and pepper, to taste.', 'Reduce heat to low and simmer for 10 minutes, stirring occasionally.', 'Serve over cooked rice or noodles.']
|
24 |
# Image of final dish: ['The final dish is a savory and flavorful beef stir-fry. The beef is cooked with onions, garlic, bell peppers, and jalapeño, and then simmered in a mixture of tomato sauce, Worcestershire sauce, soy sauce, brown sugar, red wine vinegar, and olive oil. The stir-fry is served over cooked rice or noodles.']
|
25 |
# Estimated calories in number: [500, 600]
|
26 |
+
# Healthiness score out of 100: [70]
|
27 |
# Estimated percentage of food categories: {'Vegetables': 40, 'Whole grains': 0, 'Healthy protein': 30, 'Fruits': 0, 'Healthy oils': 10}
|
28 |
# '''
|
29 |
print(response)
|
|
|
48 |
else:
|
49 |
print("Wrong calories output")
|
50 |
est_cal = est_cal[0]
|
51 |
+
healthiness = literal_eval(re.findall('Healthiness score out of 100: (\[.+\])', response)[0])
|
52 |
try:
|
53 |
healthiness = healthiness[0]
|
54 |
except:
|