mgbam commited on
Commit
96fba25
Β·
verified Β·
1 Parent(s): 4e2e4a9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -10
app.py CHANGED
@@ -13,22 +13,23 @@ async def _deploy_async(idea: str):
13
 
14
  def generate_app(idea: str):
15
  """
16
- Synchronous Gradio callback for app generation + ZIP download.
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 interface.
 
 
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(scale=1):
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(scale=1):
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
- demo.launch(
66
- server_name="0.0.0.0",
67
- server_port=int(os.environ.get("PORT", 7860)),
68
- share=False
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()