Skip to content

Commit

Permalink
🐛 bugfix: env won't reinstall if it doesn't exist. (#47)
Browse files Browse the repository at this point in the history
Co-authored-by: SunKSugaR <[email protected]>
  • Loading branch information
SunKSugaR and SunKSugaR authored Dec 3, 2024
1 parent ada4b0a commit 4ab2436
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
1 change: 1 addition & 0 deletions start_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ def main():
install_mgr.setup()

# Activate environment and run main.py
install_mgr.check_environment()
if platform.system().lower() == "windows":
activate_cmd = f"call {install_mgr.activate_script} {install_mgr.env_name}"
else:
Expand Down
1 change: 1 addition & 0 deletions start_webui.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ def main():
install_mgr.setup()

# Activate environment and run server
install_mgr.check_environment()
if platform.system().lower() == "windows":
activate_cmd = f"call {install_mgr.activate_script} {install_mgr.env_name}"
else:
Expand Down
18 changes: 11 additions & 7 deletions utils/install_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,13 +115,8 @@ def install_pip_dependencies(self):
else:
subprocess.run(["bash", "-c", pip_install_cmd], check=True)

def setup(self):
"""Run complete setup process"""
if not self.conda_dir.exists():
installer = self.download_miniconda()
self.install_miniconda(installer)

# Create environment if it doesn't exist
def check_environment(self):
"""Check if 'open-llm-vtuber' environment exists and install if not"""
result = subprocess.run(
[str(self.conda_executable), "env", "list"],
capture_output=True,
Expand All @@ -132,3 +127,12 @@ def setup(self):
self.create_environment()
self.install_conda_dependencies()
self.install_pip_dependencies()

def setup(self):
"""Run complete setup process"""
if not self.conda_dir.exists():
installer = self.download_miniconda()
self.install_miniconda(installer)

# Create environment if it doesn't exist
self.check_environment()

0 comments on commit 4ab2436

Please sign in to comment.