aboutsummaryrefslogtreecommitdiff
path: root/modules/launch_utils.py
diff options
context:
space:
mode:
Diffstat (limited to 'modules/launch_utils.py')
-rw-r--r--modules/launch_utils.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/modules/launch_utils.py b/modules/launch_utils.py
index 8e58d714..107c72b0 100644
--- a/modules/launch_utils.py
+++ b/modules/launch_utils.py
@@ -251,7 +251,6 @@ def list_extensions(settings_file):
except Exception:
errors.report(f'\nCould not load settings\nThe config file "{settings_file}" is likely corrupted\nIt has been moved to the "tmp/config.json"\nReverting config to default\n\n''', exc_info=True)
os.replace(settings_file, os.path.join(script_path, "tmp", "config.json"))
- settings = {}
disabled_extensions = set(settings.get('disabled_extensions', []))
disable_all_extensions = settings.get('disable_all_extensions', 'none')
@@ -339,6 +338,7 @@ def prepare_environment():
torch_index_url = os.environ.get('TORCH_INDEX_URL', "https://pytorch-extension.intel.com/release-whl/stable/xpu/us/")
torch_command = os.environ.get('TORCH_COMMAND', f"pip install torch==2.0.0a0 intel-extension-for-pytorch==2.0.110+gitba7f6c1 --extra-index-url {torch_index_url}")
requirements_file = os.environ.get('REQS_FILE', "requirements_versions.txt")
+ requirements_file_for_npu = os.environ.get('REQS_FILE_FOR_NPU', "requirements_npu.txt")
xformers_package = os.environ.get('XFORMERS_PACKAGE', 'xformers==0.0.23.post1')
clip_package = os.environ.get('CLIP_PACKAGE', "https://github.com/openai/CLIP/archive/d50d76daa670286dd6cacf3bcd80b5e4823fc8e1.zip")
@@ -422,6 +422,13 @@ def prepare_environment():
run_pip(f"install -r \"{requirements_file}\"", "requirements")
startup_timer.record("install requirements")
+ if not os.path.isfile(requirements_file_for_npu):
+ requirements_file_for_npu = os.path.join(script_path, requirements_file_for_npu)
+
+ if "torch_npu" in torch_command and not requirements_met(requirements_file_for_npu):
+ run_pip(f"install -r \"{requirements_file_for_npu}\"", "requirements_for_npu")
+ startup_timer.record("install requirements_for_npu")
+
if not args.skip_install:
run_extensions_installers(settings_file=args.ui_settings_file)