Ctransformers with GPU

This commit is contained in:
saloui 2023-06-16 10:03:50 +02:00
parent 7612b2e42c
commit 80fa29718a
4 changed files with 16 additions and 3 deletions

View File

@ -19,6 +19,7 @@ from tqdm import tqdm
import urllib.request
import importlib
import shutil
import subprocess
__author__ = "parisneo"
@ -203,6 +204,16 @@ class BindingInstaller:
def __init__(self, config: LOLLMSConfig) -> None:
self.config = config
def reinstall_pytorch_with_cuda(self):
result = subprocess.run(["pip", "install", "--upgrade", "torch", "torchvision", "torchaudio", "--no-cache-dir", "--index-url", "https://download.pytorch.org/whl/cu117"])
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!!")
class LLMBinding:

@ -1 +1 @@
Subproject commit 9c4658498e2a42627d6d6cb113798e8d9fcff3b3
Subproject commit 6ccb39333feec960d20846dd96ef3df798697bc5

@ -1 +1 @@
Subproject commit 259ab420e909bf4aab935c053c1b3aeed2fee719
Subproject commit 442b890763f66833d1df0940fa8f2dc3572f833d

View File

@ -257,7 +257,6 @@ def install_package(package_name):
print(f"{package_name} has been successfully installed.")
class AIPersonality:
# Extra
@ -1041,3 +1040,6 @@ Date: {{date}}
output_string = re.sub(pattern, replace, input_string)
return output_string
class AIPersonalityInstaller:
def __init__(self, personality:AIPersonality) -> None:
self.personality = personality