Spaces:
Sleeping
Sleeping
Hussnainkha
commited on
Commit
•
49af185
1
Parent(s):
915b176
Update app.py
Browse files
app.py
CHANGED
@@ -13,7 +13,7 @@ client = OpenAI(
|
|
13 |
# Function to generate the recipe and detailed instructions
|
14 |
def create_dish_prompt(list_of_ingredients, category):
|
15 |
prompt = f"Make a {category} dish with the following ingredients: " + ', '.join(
|
16 |
-
|
17 |
return prompt
|
18 |
|
19 |
# Function to generate the image
|
@@ -41,7 +41,7 @@ category = st.text_input("Enter the category of food such as fried, baked, grill
|
|
41 |
# Generate Recipe button at the bottom
|
42 |
if st.button("Generate Recipe"):
|
43 |
# Check if the user has entered ingredients
|
44 |
-
if
|
45 |
# Convert the input string into a list of ingredients
|
46 |
list_of_ingredients = [item.strip() for item in list_of_ingredients.split(',')]
|
47 |
|
|
|
13 |
# Function to generate the recipe and detailed instructions
|
14 |
def create_dish_prompt(list_of_ingredients, category):
|
15 |
prompt = f"Make a {category} dish with the following ingredients: " + ', '.join(
|
16 |
+
list_of_ingredients) + ".\nWrite down the title, detailed recipe, and a description of the image you want to generate.\n"
|
17 |
return prompt
|
18 |
|
19 |
# Function to generate the image
|
|
|
41 |
# Generate Recipe button at the bottom
|
42 |
if st.button("Generate Recipe"):
|
43 |
# Check if the user has entered ingredients
|
44 |
+
if list_of_ingredients:
|
45 |
# Convert the input string into a list of ingredients
|
46 |
list_of_ingredients = [item.strip() for item in list_of_ingredients.split(',')]
|
47 |
|