iukhan commited on
Commit
2399317
·
verified ·
1 Parent(s): 5f75dd9

Create restaurant_menu_system.py

Browse files
Files changed (1) hide show
  1. restaurant_menu_system.py +21 -0
restaurant_menu_system.py ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+
3
+ # Function to recommend dishes based on preferences
4
+ def recommend_dishes(preferences):
5
+ # Basic logic to recommend dishes (in reality, it could query a database)
6
+ if "vegan" in preferences.lower():
7
+ return "Recommended Vegan Dishes: Vegan Pizza, Vegan Burger"
8
+ elif "spicy" in preferences.lower():
9
+ return "Recommended Spicy Dishes: Spicy Chicken Wings, Spicy Tacos"
10
+ else:
11
+ return "Recommended Dishes: Margherita Pizza, Caesar Salad"
12
+
13
+ # Gradio interface for the interactive menu system
14
+ with gr.Blocks() as menu_app:
15
+ preferences = gr.Textbox(label="Enter your dietary preferences (e.g., vegan, spicy)")
16
+ recommend_button = gr.Button("Get Recommendations")
17
+ recommendations_output = gr.Textbox(label="Recommended Dishes")
18
+
19
+ recommend_button.click(fn=recommend_dishes, inputs=preferences, outputs=recommendations_output)
20
+
21
+ menu_app.launch()