Download app.py from mgbam/robosage: direct link, hf CLI and curl.
- Browser
- Download file 1.47 kB
-
https://huggingface.co/spaces/mgbam/robosage/resolve/1cb22ca80be074aef6ec85e1ae667cd89323e4bc/app.py
- Command line
-
hf download hf://spaces/mgbam/robosage@1cb22ca80be074aef6ec85e1ae667cd89323e4bc/app.py
-
curl -L -o app.py https://huggingface.co/spaces/mgbam/robosage/resolve/1cb22ca80be074aef6ec85e1ae667cd89323e4bc/app.py
1.47 kB
| # app.py - Entry point to run RoboSage App from voice idea to deployment | |
| import gradio as gr | |
| import asyncio | |
| from core_creator.voice_to_app import VoiceToAppCreator | |
| from deployer.gradio_generator import launch_gradio_app | |
| import os | |
| # Optional: configure Gemini/OpenAI keys before launch if needed | |
| os.environ["GEMINI_API_KEY"] = os.getenv("GEMINI_API_KEY", "") | |
| os.environ["OPENAI_API_KEY"] = os.getenv("OPENAI_API_KEY", "") | |
| async def handle_user_idea(idea: str): | |
| creator = VoiceToAppCreator(idea) | |
| app_assets = creator.run_pipeline() | |
| app_ui = launch_gradio_app( | |
| title=app_assets["blueprint"].get("title", "RoboApp"), | |
| description=app_assets["blueprint"].get("description", "AI-powered robot app.") | |
| ) | |
| app_ui.launch() # share=True is unnecessary inside Hugging Face Spaces | |
| return "✅ App Launched" | |
| def run_app(): | |
| with gr.Blocks() as demo: | |
| gr.Markdown("""# 🚀 RoboSage: Create Your Own Robot App from Voice | |
| Speak or type your robot idea and we’ll generate, simulate, and deploy it live. | |
| """) | |
| user_idea = gr.Textbox(label="Your Robot Idea", placeholder="e.g. A robot that reminds me to hydrate.") | |
| out = gr.Textbox(label="Status") | |
| launch_btn = gr.Button("Create & Deploy") | |
| def run_async(idea): | |
| return asyncio.run(handle_user_idea(idea)) | |
| launch_btn.click(fn=run_async, inputs=user_idea, outputs=out) | |
| demo.launch() | |
| if __name__ == "__main__": | |
| run_app() | |