Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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__":
|