From 566491c2fad656df935592786c52afaa7bf9955b Mon Sep 17 00:00:00 2001 From: Saifeddine ALOUI Date: Wed, 15 Nov 2023 13:38:49 +0100 Subject: [PATCH] Update binding.py --- lollms/binding.py | 44 +------------------------------------------- 1 file changed, 1 insertion(+), 43 deletions(-) diff --git a/lollms/binding.py b/lollms/binding.py index 6fc0b16..906d382 100644 --- a/lollms/binding.py +++ b/lollms/binding.py @@ -12,7 +12,6 @@ from typing import Callable from lollms.paths import LollmsPaths from ascii_colors import ASCIIColors - import tempfile import requests import shutil @@ -421,48 +420,7 @@ class LLMBinding: full_data+=yaml_data return full_data - - @staticmethod - def check_torch_version(min_version): - import torch - # Extract torch version from __version__ attribute with regular expression - current_version_float = float('.'.join(torch.__version__.split(".")[:2])) - # Check if the current version meets or exceeds the minimum required version - return current_version_float >= min_version - - @staticmethod - def reinstall_pytorch_with_cuda(): - result = subprocess.run(["pip", "install", "--upgrade", "torch", "torchvision", "torchaudio", "--no-cache-dir", "--index-url", "https://download.pytorch.org/whl/cu121"]) - if result.returncode != 0: - ASCIIColors.warning("Couldn't find Cuda build tools on your PC. Reverting to CPU.") - result = subprocess.run(["pip", "install", "--upgrade", "torch", "torchvision", "torchaudio", "--no-cache-dir"]) - if result.returncode != 0: - ASCIIColors.error("Couldn't install pytorch !!") - else: - ASCIIColors.error("Pytorch installed successfully!!") - - @staticmethod - def reinstall_pytorch_with_rocm(): - result = subprocess.run(["pip", "install", "--upgrade", "torch", "torchvision", "torchaudio", "--no-cache-dir", "--index-url", "https://download.pytorch.org/whl/rocm5.6"]) - if result.returncode != 0: - ASCIIColors.warning("Couldn't find Cuda build tools on your PC. Reverting to CPU.") - result = subprocess.run(["pip", "install", "--upgrade", "torch", "torchvision", "torchaudio", "--no-cache-dir"]) - if result.returncode != 0: - ASCIIColors.error("Couldn't install pytorch !!") - else: - ASCIIColors.error("Pytorch installed successfully!!") - - - @staticmethod - def reinstall_pytorch_with_cpu(): - result = subprocess.run(["pip", "install", "--upgrade", "torch", "torchvision", "torchaudio", "--no-cache-dir"]) - if result.returncode != 0: - ASCIIColors.warning("Couldn't find Cuda build tools on your PC. Reverting to CPU.") - result = subprocess.run(["pip", "install", "--upgrade", "torch", "torchvision", "torchaudio", "--no-cache-dir"]) - if result.returncode != 0: - ASCIIColors.error("Couldn't install pytorch !!") - else: - ASCIIColors.error("Pytorch installed successfully!!") + @staticmethod def vram_usage():