Update deployer/gradio_generator.py
Browse files
deployer/gradio_generator.py
CHANGED
@@ -7,7 +7,7 @@ from deployer.revenue_tracker import package_artifacts
|
|
7 |
|
8 |
async def generate_app_async(idea: str):
|
9 |
"""
|
10 |
-
|
11 |
"""
|
12 |
creator = VoiceToAppCreator(idea)
|
13 |
assets = creator.run_pipeline()
|
@@ -19,28 +19,27 @@ async def generate_app_async(idea: str):
|
|
19 |
|
20 |
def deploy_callback(idea: str):
|
21 |
"""
|
22 |
-
Synchronous wrapper for Gradio:
|
23 |
-
Returns (status_message, zip_path).
|
24 |
"""
|
25 |
return asyncio.run(generate_app_async(idea))
|
26 |
|
27 |
|
28 |
def robot_behavior(command: str) -> str:
|
29 |
"""
|
30 |
-
Simulate robot
|
31 |
"""
|
32 |
return VirtualRobot().perform_action(command)
|
33 |
|
34 |
|
35 |
def main():
|
36 |
"""
|
37 |
-
|
38 |
"""
|
39 |
-
|
|
|
40 |
gr.Markdown("# π RoboSage\nGenerate your custom robot app and test it live.")
|
41 |
|
42 |
with gr.Row():
|
43 |
-
# Generate & Download App Section
|
44 |
with gr.Column():
|
45 |
gr.Markdown("## 1οΈβ£ Generate & Download App")
|
46 |
idea_input = gr.Textbox(
|
@@ -58,7 +57,6 @@ def main():
|
|
58 |
outputs=[status_out, zip_out]
|
59 |
)
|
60 |
|
61 |
-
# Robot Simulator Section
|
62 |
with gr.Column():
|
63 |
gr.Markdown("## π€ Robot Simulator")
|
64 |
cmd_input = gr.Textbox(
|
@@ -77,7 +75,7 @@ def main():
|
|
77 |
|
78 |
demo.launch(
|
79 |
server_name="0.0.0.0",
|
80 |
-
server_port=int(os.environ.get("PORT", 7860)),
|
81 |
share=False
|
82 |
)
|
83 |
|
|
|
7 |
|
8 |
async def generate_app_async(idea: str):
|
9 |
"""
|
10 |
+
Runs the voice-to-app pipeline, packages the app into a ZIP, and returns status and ZIP path.
|
11 |
"""
|
12 |
creator = VoiceToAppCreator(idea)
|
13 |
assets = creator.run_pipeline()
|
|
|
19 |
|
20 |
def deploy_callback(idea: str):
|
21 |
"""
|
22 |
+
Synchronous wrapper for Gradio: generate app and get ZIP.
|
|
|
23 |
"""
|
24 |
return asyncio.run(generate_app_async(idea))
|
25 |
|
26 |
|
27 |
def robot_behavior(command: str) -> str:
|
28 |
"""
|
29 |
+
Simulate robot action based on a text command.
|
30 |
"""
|
31 |
return VirtualRobot().perform_action(command)
|
32 |
|
33 |
|
34 |
def main():
|
35 |
"""
|
36 |
+
Builds and launches the Gradio UI for RoboSage.
|
37 |
"""
|
38 |
+
demo = gr.Blocks()
|
39 |
+
with demo:
|
40 |
gr.Markdown("# π RoboSage\nGenerate your custom robot app and test it live.")
|
41 |
|
42 |
with gr.Row():
|
|
|
43 |
with gr.Column():
|
44 |
gr.Markdown("## 1οΈβ£ Generate & Download App")
|
45 |
idea_input = gr.Textbox(
|
|
|
57 |
outputs=[status_out, zip_out]
|
58 |
)
|
59 |
|
|
|
60 |
with gr.Column():
|
61 |
gr.Markdown("## π€ Robot Simulator")
|
62 |
cmd_input = gr.Textbox(
|
|
|
75 |
|
76 |
demo.launch(
|
77 |
server_name="0.0.0.0",
|
78 |
+
server_port=int(os.environ.get("PORT", "7860")),
|
79 |
share=False
|
80 |
)
|
81 |
|