diff --git a/app.py b/app.py index 68362b62..51dcaef7 100644 --- a/app.py +++ b/app.py @@ -847,10 +847,16 @@ class LoLLMsWebUI(LoLLMsAPPI): def upgrade_to_gpu(self): + ASCIIColors.yellow("Received command to upgrade to GPU") + ASCIIColors.info("Installing cuda toolkit") res = subprocess.check_call(["conda", "install", "-c", "nvidia/label/cuda-11.7.0", "-c", "nvidia", "-c", "conda-forge", "cuda-toolkit", "ninja", "git", "--force-reinstall"]) if res!=0: + ASCIIColors.red("Couldn't install cuda toolkit") return jsonify({'status':False, "error": "Couldn't install cuda toolkit. Make sure you are running from conda environment"}) + ASCIIColors.green("Cuda toolkit installed successfully") + ASCIIColors.green("Installing pytorch with cuda support") res = subprocess.check_call(["pip","install","--upgrade","torch==2.0.1+cu117", "torchvision", "torchaudio", "--index-url", "https://download.pytorch.org/whl/cu117"]) + ASCIIColors.green("PyTorch installed successfully") self.config.enable_gpu=True return jsonify({'status':res==0})