Update launch_utils.py

Lines 380-382 

    if args.reinstall_torch or not is_installed("torch") or not is_installed("torchvision"):
        run(f'"{python}" -m {torch_command}', "Installing torch and torchvision", "Couldn't install torch", live=True)
        startup_timer.record("install torch")

have been replaced with: 

    if args.reinstall_torch or not is_installed("torch") or not is_installed("torchvision"):
    # Skipping automatic torch install; using manually installed torch 1.12.1 + cu113
     print("Skipping torch installation. Using existing torch 1.12.1 + cu113.")
    startup_timer.record("install torch")
, which forces A1111 to use the legacy pytorch installed in venv.
pull/17156/head
Kavya Mali 2025-10-20 02:14:05 +05:30 committed by GitHub
parent 82a973c043
commit d8ee920f34
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 5 additions and 2 deletions

View File

@ -378,9 +378,11 @@ def prepare_environment():
print(f"Commit hash: {commit}")
if args.reinstall_torch or not is_installed("torch") or not is_installed("torchvision"):
run(f'"{python}" -m {torch_command}', "Installing torch and torchvision", "Couldn't install torch", live=True)
startup_timer.record("install torch")
# Skipping automatic torch install; using manually installed torch 1.12.1 + cu113
print("Skipping torch installation. Using existing torch 1.12.1 + cu113.")
startup_timer.record("install torch")
if args.use_ipex:
args.skip_torch_cuda_test = True
if not args.skip_torch_cuda_test and not check_run_python("import torch; assert torch.cuda.is_available()"):
@ -480,3 +482,4 @@ def dump_sysinfo():
file.write(text)
return filename