placed a dummy vairable in the model to get the answer in desired format.
Browse files
index.py
CHANGED
|
@@ -10,7 +10,7 @@ if not os.path.exists("captured_images"):
|
|
| 10 |
# Initialize the session state
|
| 11 |
session_state = st.session_state
|
| 12 |
if 'ingredientsList' not in session_state:
|
| 13 |
-
session_state['ingredientsList'] = []
|
| 14 |
|
| 15 |
def main():
|
| 16 |
|
|
@@ -22,10 +22,7 @@ def main():
|
|
| 22 |
|
| 23 |
#list to of Ingredients camptured
|
| 24 |
#ingredientsList =["apple", "orange", "mango"] #list()
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
# Create a VideoCapture object to access the webcam
|
| 30 |
cap = cv2.VideoCapture(0)
|
| 31 |
|
|
@@ -90,7 +87,7 @@ def displayRecipes(ingredientsList):
|
|
| 90 |
Ingredients? Give me A list of detailed recipes with measurements containing these ingredients with Nutrition Facts per 100g based on the widely accepted nutritional value of each of these ingredients. Rank the list from \
|
| 91 |
highest nutritional value to lowest. Give me results in \
|
| 92 |
following format and do not deviate from this format:\
|
| 93 |
-
['Recipe
|
| 94 |
#prompt = f"You are going to act as a nutritional expert who has a lot of knowledge about food. I have the following ingredients: {','.join(ingredientsList)}. What can I make with these ingredients? Give me a list of names of recipes, maximum five."
|
| 95 |
LLMResult = askGPT(prompt)
|
| 96 |
lystOfRecipes = LLMResult.split('\n\n')
|
|
|
|
| 10 |
# Initialize the session state
|
| 11 |
session_state = st.session_state
|
| 12 |
if 'ingredientsList' not in session_state:
|
| 13 |
+
session_state['ingredientsList'] = ["apple", "banana", "orange", "strawberries"]
|
| 14 |
|
| 15 |
def main():
|
| 16 |
|
|
|
|
| 22 |
|
| 23 |
#list to of Ingredients camptured
|
| 24 |
#ingredientsList =["apple", "orange", "mango"] #list()
|
| 25 |
+
|
|
|
|
|
|
|
|
|
|
| 26 |
# Create a VideoCapture object to access the webcam
|
| 27 |
cap = cv2.VideoCapture(0)
|
| 28 |
|
|
|
|
| 87 |
Ingredients? Give me A list of detailed recipes with measurements containing these ingredients with Nutrition Facts per 100g based on the widely accepted nutritional value of each of these ingredients. Rank the list from \
|
| 88 |
highest nutritional value to lowest. Give me results in \
|
| 89 |
following format and do not deviate from this format:\
|
| 90 |
+
['Recipe Title', 'content of recipe and nutritional facts per 100g']. Only give me the list. Do not add commentary or personalized responses. Keep it under 200 words."
|
| 91 |
#prompt = f"You are going to act as a nutritional expert who has a lot of knowledge about food. I have the following ingredients: {','.join(ingredientsList)}. What can I make with these ingredients? Give me a list of names of recipes, maximum five."
|
| 92 |
LLMResult = askGPT(prompt)
|
| 93 |
lystOfRecipes = LLMResult.split('\n\n')
|