Download deployer/gradio_generator.py from mgbam/robosage: direct link, hf CLI and curl.
- Browser
- Download file 972 Bytes
-
https://huggingface.co/spaces/mgbam/robosage/resolve/a8f1886e1e534671834283972a7fd3bac8cdf10e/deployer/gradio_generator.py
- Command line
-
hf download hf://spaces/mgbam/robosage@a8f1886e1e534671834283972a7fd3bac8cdf10e/deployer/gradio_generator.py
-
curl -L -o gradio_generator.py https://huggingface.co/spaces/mgbam/robosage/resolve/a8f1886e1e534671834283972a7fd3bac8cdf10e/deployer/gradio_generator.py
972 Bytes
| # gradio_generator.py - Launches the Gradio UI for robot app deployment | |
| import gradio as gr | |
| from core_creator.voice_to_app import VoiceToAppCreator | |
| def deploy_callback(user_input: str) -> dict: | |
| creator = VoiceToAppCreator(user_input) | |
| return creator.run_pipeline() | |
| def robot_behavior(user_input: str) -> str: | |
| result = deploy_callback(user_input) | |
| return result.get("code", "No code generated.") | |
| def launch_gradio_interface(): | |
| with gr.Blocks() as demo: | |
| gr.Markdown("# 🤖 Voice-to-Robot App Generator") | |
| with gr.Row(): | |
| input_box = gr.Textbox(label="Describe your robot idea", placeholder="e.g., A robot that helps kids brush their teeth.") | |
| output_box = gr.Code(label="Generated Code", language="python") | |
| submit_btn = gr.Button("Generate App") | |
| submit_btn.click(fn=robot_behavior, inputs=input_box, outputs=output_box) | |
| demo.launch() | |
| if __name__ == "__main__": | |
| launch_gradio_interface() | |