mirror of
https://github.com/ParisNeo/lollms.git
synced 2024-12-18 20:27:58 +00:00
Merge branch 'main' of https://github.com/ParisNeo/lollms
This commit is contained in:
commit
ced2b05d9a
@ -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:
|
||||
|
||||
|
@ -267,7 +267,7 @@ class Conversation:
|
||||
self.config = LOLLMSConfig.autoload(self.lollms_paths, configuration_path)
|
||||
|
||||
if self.config.model_name is None:
|
||||
self.menu.select_model(self)
|
||||
self.menu.select_model()
|
||||
|
||||
|
||||
# load binding
|
||||
@ -381,6 +381,8 @@ Participating personalities:
|
||||
except Exception as ex:
|
||||
print(ex)
|
||||
print(f"Couldn't find binding. Please verify your configuration file at {self.configuration_path} or use the next menu to select a valid binding")
|
||||
print(f"Trying to reinstall binding")
|
||||
self.binding_class = BindingBuilder().build_binding(self.lollms_paths.bindings_zoo_path, self.config,force_reinstall=True)
|
||||
self.menu.select_binding()
|
||||
|
||||
def load_model(self):
|
||||
|
@ -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
|
||||
|
@ -58,6 +58,8 @@ class LoLLMsServer:
|
||||
except Exception as ex:
|
||||
print(ex)
|
||||
print(f"Couldn't find binding. Please verify your configuration file at {self.config.file_path} or use the next menu to select a valid binding")
|
||||
print(f"Trying to reinstall binding")
|
||||
self.binding_class = BindingBuilder().build_binding(self.lollms_paths.bindings_zoo_path, self.config,force_reinstall=True)
|
||||
self.menu.select_binding()
|
||||
|
||||
def load_model(self):
|
||||
|
@ -153,6 +153,8 @@ Participating personalities:
|
||||
except Exception as ex:
|
||||
print(ex)
|
||||
print(f"Couldn't find binding. Please verify your configuration file at {self.cfg_path} or use the next menu to select a valid binding")
|
||||
print(f"Trying to reinstall binding")
|
||||
self.binding_class = BindingBuilder().build_binding(self.lollms_paths.bindings_zoo_path, self.config,force_reinstall=True)
|
||||
self.menu.select_binding()
|
||||
|
||||
def load_model(self):
|
||||
|
Loading…
Reference in New Issue
Block a user