From bb79037ebd2d602614a6a19ff28ac4fcc98e1ded Mon Sep 17 00:00:00 2001 From: oobabooga <112222186+oobabooga@users.noreply.github.com> Date: Fri, 7 Jul 2023 20:40:31 -0300 Subject: [PATCH] Fix wrong pytorch version on Linux+CPU It was installing nvidia wheels --- webui.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/webui.py b/webui.py index 004752a9..25c2d367 100644 --- a/webui.py +++ b/webui.py @@ -87,8 +87,14 @@ def install_dependencies(): elif gpuchoice == "b": print("AMD GPUs are not supported. Exiting...") sys.exit() - elif gpuchoice == "c" or gpuchoice == "d": + elif gpuchoice == "c": run_cmd("conda install -y -k ninja git && python -m pip install torch torchvision torchaudio", assert_success=True, environment=True) + elif gpuchoice == "d": + if sys.platform.startswith("linux"): + run_cmd("conda install -y -k ninja git && python -m pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu", assert_success=True, environment=True) + else: + run_cmd("conda install -y -k ninja git && python -m pip install torch torchvision torchaudio", assert_success=True, environment=True) + else: print("Invalid choice. Exiting...") sys.exit()