Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bugfix: env won't reinstall if it doesn't exist. #47

Merged
merged 1 commit into from
Dec 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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()