Update app.py
Browse files
app.py
CHANGED
@@ -13,22 +13,23 @@ async def _deploy_async(idea: str):
|
|
13 |
|
14 |
def generate_app(idea: str):
|
15 |
"""
|
16 |
-
|
17 |
"""
|
18 |
status, zip_path = asyncio.run(_deploy_async(idea))
|
19 |
return status, zip_path
|
20 |
|
21 |
def main():
|
22 |
"""
|
23 |
-
Build and launch the Gradio
|
|
|
|
|
24 |
"""
|
25 |
-
# No inline CSS hereβstyling lives in deployer/gradio_generator.py
|
26 |
with gr.Blocks() as demo:
|
27 |
gr.Markdown("# π RoboSage\nGenerate your custom robot app and test it live.")
|
28 |
|
29 |
with gr.Row():
|
30 |
# βββββββββ Generate & Download App βββββββββ
|
31 |
-
with gr.Column(
|
32 |
gr.Markdown("## 1οΈβ£ Generate & Download App")
|
33 |
idea_input = gr.Textbox(
|
34 |
label="Your Robot Idea",
|
@@ -46,7 +47,7 @@ def main():
|
|
46 |
)
|
47 |
|
48 |
# βββββββββ Robot Simulator βββββββββ
|
49 |
-
with gr.Column(
|
50 |
gr.Markdown("## π€ Robot Simulator")
|
51 |
cmd_input = gr.Textbox(
|
52 |
label="Command",
|
@@ -62,11 +63,11 @@ def main():
|
|
62 |
outputs=[sim_out]
|
63 |
)
|
64 |
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
|
71 |
if __name__ == "__main__":
|
72 |
main()
|
|
|
13 |
|
14 |
def generate_app(idea: str):
|
15 |
"""
|
16 |
+
Gradio callback: run the pipeline, package the app, and return (status, zip_path).
|
17 |
"""
|
18 |
status, zip_path = asyncio.run(_deploy_async(idea))
|
19 |
return status, zip_path
|
20 |
|
21 |
def main():
|
22 |
"""
|
23 |
+
Build and launch the Gradio UI:
|
24 |
+
- Left column: Generate & Download App
|
25 |
+
- Right column: Robot Simulator
|
26 |
"""
|
|
|
27 |
with gr.Blocks() as demo:
|
28 |
gr.Markdown("# π RoboSage\nGenerate your custom robot app and test it live.")
|
29 |
|
30 |
with gr.Row():
|
31 |
# βββββββββ Generate & Download App βββββββββ
|
32 |
+
with gr.Column():
|
33 |
gr.Markdown("## 1οΈβ£ Generate & Download App")
|
34 |
idea_input = gr.Textbox(
|
35 |
label="Your Robot Idea",
|
|
|
47 |
)
|
48 |
|
49 |
# βββββββββ Robot Simulator βββββββββ
|
50 |
+
with gr.Column():
|
51 |
gr.Markdown("## π€ Robot Simulator")
|
52 |
cmd_input = gr.Textbox(
|
53 |
label="Command",
|
|
|
63 |
outputs=[sim_out]
|
64 |
)
|
65 |
|
66 |
+
demo.launch(
|
67 |
+
server_name="0.0.0.0",
|
68 |
+
server_port=int(os.environ.get("PORT", "7860")),
|
69 |
+
share=False
|
70 |
+
)
|
71 |
|
72 |
if __name__ == "__main__":
|
73 |
main()
|