OpenVINO downgrade PyTorch

This commit is contained in:
Disty0
2023-11-15 22:33:13 +03:00
parent f5f14282fb
commit bb0430f5c1
2 changed files with 31 additions and 2 deletions
+1 -1
View File
@@ -149,7 +149,7 @@ def load_networks(names, te_multipliers=None, unet_multipliers=None, dyn_dims=No
break
else:
recompile_model = True
shared.compiled_model_state.lora_model = []
shared.compiled_model_state.lora_model = []
if recompile_model:
sd_models.unload_model_weights(op='model')
shared.opts.cuda_compile = False
+30 -1
View File
@@ -447,7 +447,36 @@ def check_torch():
install('onnxruntime-openvino', 'onnxruntime-openvino', ignore=True) # TODO numpy version conflicts with tensorflow and doesn't support Python 3.11
elif allow_openvino and args.use_openvino:
log.info('Using OpenVINO')
torch_command = os.environ.get('TORCH_COMMAND', 'torch==2.1.0 torchvision==0.16.0 --index-url https://download.pytorch.org/whl/cpu')
if "linux" in sys.platform:
if sys.version_info[1] == 11:
pytorch_pip = 'https://github.com/Disty0/automatic/releases/download/openvino_pre_release_pytorch/torch-2.1.0.dev20230820+cpu-cp311-cp311-linux_x86_64.whl'
torchvision_pip = 'https://github.com/Disty0/automatic/releases/download/openvino_pre_release_pytorch/torchvision-0.16.0.dev20230820+cpu-cp311-cp311-linux_x86_64.whl'
elif sys.version_info[1] == 10:
pytorch_pip = 'https://github.com/Disty0/automatic/releases/download/openvino_pre_release_pytorch/torch-2.1.0.dev20230820+cpu-cp310-cp310-linux_x86_64.whl'
torchvision_pip = 'https://github.com/Disty0/automatic/releases/download/openvino_pre_release_pytorch/torchvision-0.16.0.dev20230820+cpu-cp310-cp310-linux_x86_64.whl'
elif sys.version_info[1] == 8:
pytorch_pip = 'https://github.com/Disty0/automatic/releases/download/openvino_pre_release_pytorch/torch-2.1.0.dev20230820+cpu-cp38-cp38-linux_x86_64.whl'
torchvision_pip = 'https://github.com/Disty0/automatic/releases/download/openvino_pre_release_pytorch/torchvision-0.16.0.dev20230820+cpu-cp38-cp38-linux_x86_64.whl'
else:
pytorch_pip = 'torch==2.1.0'
torchvision_pip = 'torchvision==0.16.0 --index-url https://download.pytorch.org/whl/cpu'
elif sys.platform == 'darwin':
pytorch_pip = 'torch==2.1.0'
torchvision_pip = 'torchvision==0.16.0 --index-url https://download.pytorch.org/whl/cpu'
else:
if sys.version_info[1] == 11:
pytorch_pip = 'https://github.com/Disty0/automatic/releases/download/openvino_pre_release_pytorch/torch-2.1.0.dev20230820+cpu-cp311-cp311-win_amd64.whl'
torchvision_pip = 'https://github.com/Disty0/automatic/releases/download/openvino_pre_release_pytorch/torchvision-0.16.0.dev20230820+cpu-cp311-cp311-win_amd64.whl'
elif sys.version_info[1] == 10:
pytorch_pip = 'https://github.com/Disty0/automatic/releases/download/openvino_pre_release_pytorch/torch-2.1.0.dev20230820+cpu-cp310-cp310-win_amd64.whl'
torchvision_pip = 'https://github.com/Disty0/automatic/releases/download/openvino_pre_release_pytorch/torchvision-0.16.0.dev20230820+cpu-cp310-cp310-win_amd64.whl'
elif sys.version_info[1] == 8:
pytorch_pip = 'https://github.com/Disty0/automatic/releases/download/openvino_pre_release_pytorch/torch-2.1.0.dev20230820+cpu-cp38-cp38-win_amd64.whl'
torchvision_pip = 'https://github.com/Disty0/automatic/releases/download/openvino_pre_release_pytorch/torchvision-0.16.0.dev20230820+cpu-cp38-cp38-win_amd64.whl'
else:
pytorch_pip = 'torch==2.1.0'
torchvision_pip = 'torchvision==0.16.0 --index-url https://download.pytorch.org/whl/cpu'
torch_command = os.environ.get('TORCH_COMMAND', f'{pytorch_pip} {torchvision_pip}')
else:
machine = platform.machine()
if sys.platform == 'darwin':