voice / app.py
Subbu1304's picture
Update app.py
f3be9dc verified
raw
history blame contribute delete
976 Bytes
import gradio as gr
return f"Command not recognized: {command}"
# Define Gradio interfaces
menu_interface = gr.Interface(
fn=get_menu,
inputs=None,
outputs="json",
description="Get the menu."
)
order_interface = gr.Interface(
fn=place_order,
inputs=["text", "text"],
outputs="text",
description="Place an order by providing a comma-separated list of items and customizations."
)
speak_interface = gr.Interface(
fn=text_to_speech,
inputs="text",
outputs="text",
description="Convert text to speech."
)
speech_recognition_interface = gr.Interface(
fn=live_speech,
inputs=None,
outputs="text",
description="Speak commands like 'Show menu' or 'Order Biryani'."
)
# Combine all interfaces
app = gr.TabbedInterface([
menu_interface,
order_interface,
speak_interface,
speech_recognition_interface
], ["Menu", "Order", "Speak", "Voice Commands"])
if __name__ == "__main__":
app.launch()