diff --git a/modules/launch_utils.py b/modules/launch_utils.py index e22da4ec6..0ee5ff1dd 100644 --- a/modules/launch_utils.py +++ b/modules/launch_utils.py @@ -337,6 +337,7 @@ def prepare_environment(): # See https://intel.github.io/intel-extension-for-pytorch/index.html#installation for details. 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_temp = os.environment.get('REQS_FILE', "requirements_temp.txt") requirements_file = os.environ.get('REQS_FILE', "requirements_versions.txt") requirements_file_for_npu = os.environ.get('REQS_FILE_FOR_NPU', "requirements_npu.txt") @@ -415,6 +416,13 @@ def prepare_environment(): startup_timer.record("clone repositores") + if not os.path.isfile(requirements_file_temp): + requirements_file_temp = os.path.join(script_path, requirements_file_temp) + + if not requirements_met(requirements_file_temp): + run_pip(f"install -r \"{requirements_file_temp}\"", "requirements_temp") + startup_timer.record("install requirements_temp") + if not os.path.isfile(requirements_file): requirements_file = os.path.join(script_path, requirements_file) diff --git a/requirements_temp.txt b/requirements_temp.txt new file mode 100644 index 000000000..0c636cc6a --- /dev/null +++ b/requirements_temp.txt @@ -0,0 +1 @@ +setuptools==69.5.1 # temp fix for compatibility with some old packages \ No newline at end of file