Spaces:
Build error
Build error
DSatishchandra
commited on
Commit
•
2680d6c
1
Parent(s):
d67403c
Update app.py
Browse files
app.py
CHANGED
@@ -1,6 +1,12 @@
|
|
1 |
import gradio as gr
|
2 |
-
import order_assistant # The module you renamed to 'order_assistant'
|
3 |
import asyncio
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4 |
|
5 |
# Gradio interface function
|
6 |
async def food_order_interface(audio_input, food_type):
|
@@ -9,7 +15,7 @@ async def food_order_interface(audio_input, food_type):
|
|
9 |
|
10 |
# Create Gradio application
|
11 |
async def create_demo():
|
12 |
-
demo = gr.Interface(fn=food_order_interface,
|
13 |
inputs=[gr.Audio(type="filepath", label="Order Food"), # Microphone input for audio file
|
14 |
gr.Dropdown(choices=["Starters", "Main Course", "Desserts"], label="Food Type")],
|
15 |
outputs=[gr.Audio(label="Order Confirmation Audio"),
|
|
|
1 |
import gradio as gr
|
|
|
2 |
import asyncio
|
3 |
+
from order_assistant import OrderAssistant, load_food_menu # Import OrderAssistant and load_food_menu
|
4 |
+
|
5 |
+
# Load the food menu from the menu.json file
|
6 |
+
food_menu = load_food_menu()
|
7 |
+
|
8 |
+
# Initialize the food order assistant with the food menu
|
9 |
+
order_assistant = OrderAssistant(food_menu)
|
10 |
|
11 |
# Gradio interface function
|
12 |
async def food_order_interface(audio_input, food_type):
|
|
|
15 |
|
16 |
# Create Gradio application
|
17 |
async def create_demo():
|
18 |
+
demo = gr.Interface(fn=food_order_interface,
|
19 |
inputs=[gr.Audio(type="filepath", label="Order Food"), # Microphone input for audio file
|
20 |
gr.Dropdown(choices=["Starters", "Main Course", "Desserts"], label="Food Type")],
|
21 |
outputs=[gr.Audio(label="Order Confirmation Audio"),
|