From 771e9367696f24186a0e6ab3beff857d9b41f7e2 Mon Sep 17 00:00:00 2001 From: oobabooga <112222186+oobabooga@users.noreply.github.com> Date: Thu, 28 Sep 2023 14:27:25 -0700 Subject: [PATCH] Fix extensions install (2nd attempt) --- one_click.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/one_click.py b/one_click.py index 6e555fcb..08f80fda 100644 --- a/one_click.py +++ b/one_click.py @@ -191,11 +191,12 @@ def update_requirements(initial_installation=False): # Extensions requirements are installed only during the initial install by default. # That can be changed with the INSTALL_EXTENSIONS environment variable. - install_extensions = os.environ.get("INSTALL_EXTENSIONS", "false").lower() in ("yes", "y", "true", "1", "t", "on") - if initial_installation and not install_extensions: - print_big_message("Will not install extensions due to INSTALL_EXTENSIONS environment variable.") - elif initial_installation or install_extensions: - print("Installing extensions requirements.") + install = initial_installation + if "INSTALL_EXTENSIONS" in os.environ: + install = os.environ["INSTALL_EXTENSIONS"].lower() in ("yes", "y", "true", "1", "t", "on") + + if install: + print_big_message("Installing extensions requirements.") extensions = next(os.walk("extensions"))[1] for extension in extensions: if extension in ['superbooga', 'superboogav2']: # No wheels available for requirements @@ -204,6 +205,8 @@ def update_requirements(initial_installation=False): extension_req_path = os.path.join("extensions", extension, "requirements.txt") if os.path.exists(extension_req_path): run_cmd("python -m pip install -r " + extension_req_path + " --upgrade", assert_success=True, environment=True) + elif initial_installation: + print_big_message("Will not install extensions due to INSTALL_EXTENSIONS environment variable.") # Detect the PyTorch version torver = torch_version() @@ -233,7 +236,7 @@ def update_requirements(initial_installation=False): else: requirements_file = "requirements_noavx2.txt" - print(f"Using the following requirements file: {requirements_file}") + print_big_message(f"Installing webui requirements from file: {requirements_file}") textgen_requirements = open(requirements_file).read().splitlines()