J Z commited on
Commit
d8df6a1
·
verified ·
1 Parent(s): 543ea03

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -3
app.py CHANGED
@@ -6,6 +6,7 @@ import time
6
  # Configure paths
7
  DARWIN_SCRIPTS_PATH = "/data/DarwinChatbot/scripts"
8
  OLLAMA_PATH = "/data/DarwinChatbot/ollama"
 
9
 
10
  # Start Ollama in background using basic shell command
11
  print("Starting Ollama server...")
@@ -21,6 +22,7 @@ os.environ["NICEGUI_HOST"] = "0.0.0.0"
21
  # Change to the DarwinChatbot scripts directory
22
  os.chdir(DARWIN_SCRIPTS_PATH)
23
 
24
- # Execute app.py directly
25
- print("Starting Darwin Avatar app...")
26
- exec(open("app.py").read())
 
 
6
  # Configure paths
7
  DARWIN_SCRIPTS_PATH = "/data/DarwinChatbot/scripts"
8
  OLLAMA_PATH = "/data/DarwinChatbot/ollama"
9
+ CONDA_PATH = "/data/DarwinChatbot/miniconda3"
10
 
11
  # Start Ollama in background using basic shell command
12
  print("Starting Ollama server...")
 
22
  # Change to the DarwinChatbot scripts directory
23
  os.chdir(DARWIN_SCRIPTS_PATH)
24
 
25
+ # Use the conda environment's Python to run app.py
26
+ print("Starting Darwin Avatar app with conda environment...")
27
+ conda_python = f"{CONDA_PATH}/envs/DarwinChatbot/bin/python"
28
+ subprocess.run([conda_python, "app.py"])