Download app.py from Subbu1304/voice: direct link, hf CLI and curl.
- Browser
- Download file 976 Bytes
-
https://huggingface.co/spaces/Subbu1304/voice/resolve/main/app.py
- Command line
-
hf download hf://spaces/Subbu1304/voice/app.py
-
curl -L -o app.py https://huggingface.co/spaces/Subbu1304/voice/resolve/main/app.py
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() |