Subbu1304 commited on
Commit
4fa3ff7
·
verified ·
1 Parent(s): edf3726

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +26 -13
app.py CHANGED
@@ -67,19 +67,32 @@ def display_interface():
67
  dish_names = [dish["name"] for dish in dishes]
68
 
69
  # Gradio Interface for Dish Selection and Occasion Input
70
- with gr.Blocks() as demo:
71
- gr.Markdown("### Welcome to the Restaurant! 🍽️")
72
-
73
- with gr.Row():
74
- dish_input = gr.CheckboxGroup(dish_names, label="Select Dishes", type="value")
75
- occasion_input = gr.Textbox(label="Enter Occasion (e.g., Birthday, Anniversary)", placeholder="Enter Occasion")
76
-
77
- generate_btn = gr.Button("Generate Invoice")
78
- invoice_output = gr.Textbox(label="Generated Invoice", lines=20)
79
-
80
- generate_btn.click(generate_invoice, inputs=[dish_input, occasion_input], outputs=invoice_output)
81
-
82
- demo.launch()
 
 
 
 
 
 
 
 
 
 
 
 
 
83
 
84
  # Run the Gradio interface
85
  if __name__ == "__main__":
 
67
  dish_names = [dish["name"] for dish in dishes]
68
 
69
  # Gradio Interface for Dish Selection and Occasion Input
70
+ with gr.Blocks() as demo:
71
+ gr.Markdown("""# Restaurant Invoice Generator
72
+ ### Welcome to our restaurant!
73
+ Use this app to place your order and generate a customized invoice.
74
+ """)
75
+
76
+ with gr.Row():
77
+ customer_name = gr.Textbox(label="Customer Name")
78
+ table_number = gr.Textbox(label="Table Number")
79
+
80
+ menu_display = gr.Textbox(show_label=False, interactive=False, value=render_menu())
81
+
82
+ selected_items = gr.Textbox(label="Selected Items (comma-separated)", placeholder="e.g., Roti, Paneer Butter Masala")
83
+ wishes = gr.Textbox(label="Special Wishes (comma-separated)", placeholder="e.g., Extra spicy, Less salt")
84
+
85
+ generate_invoice_btn = gr.Button("Generate Invoice")
86
+
87
+ invoice_output = gr.Textbox(label="Generated Invoice", lines=15, interactive=False)
88
+
89
+ # Ensure all 4 inputs are passed to the function
90
+ generate_invoice_btn.click(
91
+ generate_invoice,
92
+ inputs=[customer_name, table_number, selected_items, wishes],
93
+ outputs=invoice_output
94
+ )
95
+
96
 
97
  # Run the Gradio interface
98
  if __name__ == "__main__":