RemiFabre commited on
Commit
a30f4a8
·
1 Parent(s): 0d7b0c4

Use dedicated port 7870 for the app

Browse files
Files changed (1) hide show
  1. src/feeling_machine/main.py +8 -3
src/feeling_machine/main.py CHANGED
@@ -21,6 +21,9 @@ from feeling_machine.utils import (
21
  log_connection_troubleshooting,
22
  )
23
 
 
 
 
24
 
25
  def update_chatbot(chatbot: List[Dict[str, Any]], response: Dict[str, Any]) -> List[Dict[str, Any]]:
26
  """Update the chatbot with AdditionalOutputs."""
@@ -199,9 +202,11 @@ def run(
199
  if args.gradio:
200
  print("\n" + "=" * 50)
201
  print(" Feeling Machine is running!")
202
- print(" Open: http://127.0.0.1:7861/")
203
  print("=" * 50 + "\n")
204
- stream_manager.launch()
 
 
205
  except KeyboardInterrupt:
206
  logger.info("Keyboard interruption in main thread... closing server.")
207
  finally:
@@ -227,7 +232,7 @@ def run(
227
  class FeelingMachine(ReachyMiniApp): # type: ignore[misc]
228
  """Reachy Mini Apps entry point for the conversation app."""
229
 
230
- custom_app_url = "http://0.0.0.0:7861/"
231
  dont_start_webserver = False
232
 
233
  def run(self, reachy_mini: ReachyMini, stop_event: threading.Event) -> None:
 
21
  log_connection_troubleshooting,
22
  )
23
 
24
+ # Server port for the Gradio interface
25
+ APP_PORT = 7870
26
+
27
 
28
  def update_chatbot(chatbot: List[Dict[str, Any]], response: Dict[str, Any]) -> List[Dict[str, Any]]:
29
  """Update the chatbot with AdditionalOutputs."""
 
202
  if args.gradio:
203
  print("\n" + "=" * 50)
204
  print(" Feeling Machine is running!")
205
+ print(f" Open: http://127.0.0.1:{APP_PORT}/")
206
  print("=" * 50 + "\n")
207
+ stream_manager.launch(server_port=APP_PORT)
208
+ else:
209
+ stream_manager.launch()
210
  except KeyboardInterrupt:
211
  logger.info("Keyboard interruption in main thread... closing server.")
212
  finally:
 
232
  class FeelingMachine(ReachyMiniApp): # type: ignore[misc]
233
  """Reachy Mini Apps entry point for the conversation app."""
234
 
235
+ custom_app_url = f"http://0.0.0.0:{APP_PORT}/"
236
  dont_start_webserver = False
237
 
238
  def run(self, reachy_mini: ReachyMini, stop_event: threading.Event) -> None: