RyeCatcher commited on
Commit
86137a7
·
verified ·
1 Parent(s): b981b5c

fix: call wrapped_run() for daemon compatibility

Browse files
Files changed (1) hide show
  1. echo/main.py +7 -54
echo/main.py CHANGED
@@ -660,59 +660,12 @@ You have a physical robot body with a head and antennas. You can express emotion
660
  logger.warning(f"Idle animation failed: {e}")
661
 
662
 
663
- # === Standalone Testing ===
664
 
665
- if __name__ == "__main__":
666
- import sys
667
-
668
- logging.basicConfig(
669
- level=logging.INFO,
670
- format="%(asctime)s - %(name)s - %(levelname)s - %(message)s",
671
- )
672
-
673
- sim_mode = "--sim" in sys.argv
674
-
675
- if sim_mode:
676
- print("Running Echo in simulation mode...")
677
- print(f"LiteLLM URL: {DEFAULT_LITELLM_URL}")
678
- print(f"Model: {DEFAULT_MODEL}")
679
- print()
680
-
681
- # Create mock stop event
682
- stop_event = Event()
683
-
684
- # Initialize Echo
685
- echo = ReachyMiniEcho()
686
- echo.reachy = None
687
- echo.stop_event = stop_event
688
-
689
- # Initialize systems
690
- echo._init_systems()
691
-
692
- # Build and launch UI
693
- app = echo._build_ui()
694
 
695
- print("Starting Gradio UI...")
696
- print("Open http://localhost:7861 in your browser")
697
- print()
698
-
699
- try:
700
- app.launch(
701
- server_name="0.0.0.0",
702
- server_port=7861,
703
- show_error=True,
704
- )
705
- except KeyboardInterrupt:
706
- print("\nShutting down...")
707
- echo._cleanup()
708
- else:
709
- print("Reachy Echo")
710
- print("=" * 40)
711
- print()
712
- print("Usage:")
713
- print(" python -m reachy_mini_echo --sim # Simulation mode (no robot)")
714
- print()
715
- print("For real robot, install via daemon:")
716
- print(" cd ~/apps/reachy/apps/echo")
717
- print(" pip install -e .")
718
- print(" # Restart daemon, access via dashboard")
 
660
  logger.warning(f"Idle animation failed: {e}")
661
 
662
 
 
663
 
664
+ # === Entry Point for Daemon ===
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
665
 
666
+ if __name__ == "__main__":
667
+ app = ReachyMiniEcho()
668
+ try:
669
+ app.wrapped_run()
670
+ except KeyboardInterrupt:
671
+ app.stop()