From 838108ef01df3d53284e891ad17706e95ee42dfa Mon Sep 17 00:00:00 2001 From: Zachary Vorhies Date: Mon, 8 Jan 2024 11:32:48 -0800 Subject: [PATCH] Update install_cuda.py --- install_cuda.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/install_cuda.py b/install_cuda.py index 77fa91e..39c6ff1 100644 --- a/install_cuda.py +++ b/install_cuda.py @@ -40,7 +40,16 @@ # Delete the torch package if it doesn't have the cuda version if args.force or True: # always do this path now. - subprocess.run(["pip", "uninstall", "-y", "torch", "torchtext", "torchdata", "torchaudio", "torchvision", "torch-directml"], check=True) + uninstall = [ + "torch", + "torchtext", + "torchdata", + "torchaudio", + "torchvision", + "torch-directm" + ] + for package in uninstall: + subprocess.run(["pip", "uninstall", "-y", package], check=True) subprocess.run(["pip", "cache", "purge"], check=True) else: if TENSOR_CUDA_VERSION not in pip_list_stdout: