Download deployer/gradio_generator.py from mgbam/robosage: direct link, hf CLI and curl.
- Browser
- Download file 1.23 kB
-
https://huggingface.co/spaces/mgbam/robosage/resolve/f6b05dc604c3dc8c59a50df72963d1adf238e9a7/deployer/gradio_generator.py
- Command line
-
hf download hf://spaces/mgbam/robosage@f6b05dc604c3dc8c59a50df72963d1adf238e9a7/deployer/gradio_generator.py
-
curl -L -o gradio_generator.py https://huggingface.co/spaces/mgbam/robosage/resolve/f6b05dc604c3dc8c59a50df72963d1adf238e9a7/deployer/gradio_generator.py
1.23 kB
| # gradio_generator.py - Gradio UI for Voice-to-App Creator | |
| import gradio as gr | |
| from core_creator.voice_to_app import VoiceToAppCreator | |
| def deploy_callback(voice_input): | |
| """ | |
| Callback function to process voice input and generate the robot app package. | |
| """ | |
| creator = VoiceToAppCreator(voice_input) | |
| app_package = creator.run_pipeline() | |
| return app_package | |
| def robot_behavior(): | |
| """ | |
| Defines the Gradio interface for the Voice-to-App Creator. | |
| """ | |
| with gr.Blocks() as demo: | |
| gr.Markdown("# 🤖 Voice-to-App Creator") | |
| gr.Markdown("Describe your robot idea, and we'll generate an app for it!") | |
| with gr.Row(): | |
| voice_input = gr.Textbox( | |
| label="Your Robot Idea", | |
| placeholder="e.g., Build a robot that teaches kids to brush their teeth with fun animations.", | |
| lines=3 | |
| ) | |
| submit_button = gr.Button("Generate App") | |
| output = gr.JSON(label="Generated App Package") | |
| submit_button.click( | |
| fn=deploy_callback, | |
| inputs=voice_input, | |
| outputs=output | |
| ) | |
| return demo | |
| if __name__ == "__main__": | |
| demo = robot_behavior() | |
| demo.launch() | |