RyeCatcher commited on
Commit
d837325
·
verified ·
1 Parent(s): 3787b32

fix: add dont_start_webserver=True and use port 7863

Browse files
Files changed (1) hide show
  1. echo/main.py +7 -5
echo/main.py CHANGED
@@ -42,7 +42,9 @@ class ReachyMiniEcho(ReachyMiniApp):
42
  """
43
 
44
  # URL for the Gradio settings UI (detected by desktop app)
45
- custom_app_url: str | None = "http://localhost:7861"
 
 
46
 
47
  def __init__(self):
48
  super().__init__()
@@ -187,7 +189,7 @@ You have a physical robot body with a head and antennas. You can express emotion
187
  def run_gradio():
188
  self._gradio_app.launch(
189
  server_name="0.0.0.0",
190
- server_port=7861,
191
  share=False,
192
  prevent_thread_lock=True,
193
  show_error=True,
@@ -195,7 +197,7 @@ You have a physical robot body with a head and antennas. You can express emotion
195
 
196
  self._ui_thread = Thread(target=run_gradio, daemon=True)
197
  self._ui_thread.start()
198
- logger.info("Gradio UI started on http://localhost:7861")
199
 
200
  def _build_ui(self) -> gr.Blocks:
201
  """Build a polished Gradio interface."""
@@ -214,7 +216,7 @@ You have a physical robot body with a head and antennas. You can express emotion
214
 
215
  Thread(target=start_loop, daemon=True).start()
216
 
217
- # Connect provider and get available models
218
  try:
219
  run_async(self.provider.connect())
220
  run_async(self.provider.set_system_prompt(self._system_prompt))
@@ -222,7 +224,7 @@ You have a physical robot body with a head and antennas. You can express emotion
222
  self._available_models = run_async(self.provider.get_available_models())
223
  logger.info(f"Provider connected. {len(self._available_models)} models available.")
224
  except Exception as e:
225
- logger.error(f"Failed to connect provider: {e}")
226
  self._is_connected = False
227
  self._available_models = [DEFAULT_MODEL]
228
 
 
42
  """
43
 
44
  # URL for the Gradio settings UI (detected by desktop app)
45
+ custom_app_url: str | None = "http://localhost:7863"
46
+ # Don't start ReachyMiniApp's built-in webserver - we use Gradio
47
+ dont_start_webserver: bool = True
48
 
49
  def __init__(self):
50
  super().__init__()
 
189
  def run_gradio():
190
  self._gradio_app.launch(
191
  server_name="0.0.0.0",
192
+ server_port=7863,
193
  share=False,
194
  prevent_thread_lock=True,
195
  show_error=True,
 
197
 
198
  self._ui_thread = Thread(target=run_gradio, daemon=True)
199
  self._ui_thread.start()
200
+ logger.info("Gradio UI started on http://localhost:7863")
201
 
202
  def _build_ui(self) -> gr.Blocks:
203
  """Build a polished Gradio interface."""
 
216
 
217
  Thread(target=start_loop, daemon=True).start()
218
 
219
+ # Connect provider and get available models (with fast timeout)
220
  try:
221
  run_async(self.provider.connect())
222
  run_async(self.provider.set_system_prompt(self._system_prompt))
 
224
  self._available_models = run_async(self.provider.get_available_models())
225
  logger.info(f"Provider connected. {len(self._available_models)} models available.")
226
  except Exception as e:
227
+ logger.warning(f"Provider not available (will retry on use): {e}")
228
  self._is_connected = False
229
  self._available_models = [DEFAULT_MODEL]
230