Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,27 +1,20 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
|
| 3 |
-
#
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
filtered_data = menu_data[menu_data["Ingredients"].str.contains("Chicken|Mutton|Fish|Prawns|Goat", case=False, na=False)]
|
| 19 |
-
elif preference == "Vegetarian":
|
| 20 |
-
filtered_data = menu_data[~menu_data["Ingredients"].str.contains("Chicken|Mutton|Fish|Prawns|Goat", case=False, na=False)]
|
| 21 |
-
elif preference == "Guilt-Free":
|
| 22 |
-
filtered_data = menu_data[menu_data["Description"].str.contains(r"Fat: ([0-9]|10)g", case=False, na=False)]
|
| 23 |
-
else: # Default to "All"
|
| 24 |
-
filtered_data = menu_data
|
| 25 |
|
| 26 |
# Step 2: Generate HTML for food items
|
| 27 |
def generate_food_menu():
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
|
| 3 |
+
# Step 1: Define food items
|
| 4 |
+
food_items = [
|
| 5 |
+
{
|
| 6 |
+
"name": "Samosa",
|
| 7 |
+
"price": "$0.6",
|
| 8 |
+
"description": "Crispy fried pastry filled with spiced potatoes and peas. Serves 1. [Energy: 200 kcal, Protein: 5g, Carbohydrates: 25g, Fiber: 3g, Fat: 10g, Sugar: 1g]",
|
| 9 |
+
"image": "https://huggingface.co/spaces/DSatishchandra/DynamicFoodMenu/raw/main/images/Potato-Samosa.jpg"
|
| 10 |
+
},
|
| 11 |
+
{
|
| 12 |
+
"name": "Onion Pakoda",
|
| 13 |
+
"price": "$0.75",
|
| 14 |
+
"description": "Deep-fried onion fritters seasoned with herbs and spices. Serves 2. [Energy: 250 kcal, Protein: 6g, Carbohydrates: 30g, Fiber: 4g, Fat: 12g, Sugar: 2g]",
|
| 15 |
+
"image": "https://huggingface.co/spaces/DSatishchandra/DynamicFoodMenu/raw/main/images/onion-pakoda.jpg"
|
| 16 |
+
}
|
| 17 |
+
]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 18 |
|
| 19 |
# Step 2: Generate HTML for food items
|
| 20 |
def generate_food_menu():
|