This commit is contained in:
Saifeddine ALOUI 2023-06-13 21:19:34 +02:00
parent 2013bb4fa7
commit 519dc40d1b
4 changed files with 35 additions and 2 deletions

View File

@ -2,6 +2,7 @@ from lollms.personality import AIPersonality, MSG_TYPE
from lollms.binding import LOLLMSConfig, LLMBinding
from lollms.helpers import ASCIIColors
from lollms.paths import LollmsPaths
from lollms import reset_all_installs
import shutil
import yaml
from pathlib import Path
@ -554,10 +555,14 @@ def main():
parser.add_argument('--reset_personal_path', action='store_true', help='Reset the personal path')
parser.add_argument('--reset_config', action='store_true', help='Reset the configurations')
parser.add_argument('--reset_installs', action='store_true', help='Reset all installation status')
# Parse the command-line arguments
args = parser.parse_args()
if args.reset_installs:
reset_all_installs()
if args.reset_personal_path:
LollmsPaths.reset_configs()

@ -1 +1 @@
Subproject commit eeac74b6b10e3e7a1df6c437151f544f6b135583
Subproject commit dff6ac4a0a925532cbc2d1681c45bc59aaec4f57

View File

@ -8,6 +8,7 @@ from lollms.console import MainMenu
from lollms.paths import LollmsPaths
from lollms.console import MainMenu
from lollms import BindingBuilder, ModelBuilder, PersonalityBuilder
from lollms import reset_all_installs
from typing import List, Tuple
import importlib
from pathlib import Path
@ -407,12 +408,32 @@ class LoLLMsServer:
help='Model name')
parser.add_argument('--personality_full_name', '-p', default="personality",
help='Personality path relative to the personalities folder (language/category/name)')
parser.add_argument('--reset_personal_path', action='store_true', help='Reset the personal path')
parser.add_argument('--reset_config', action='store_true', help='Reset the configurations')
parser.add_argument('--reset_installs', action='store_true', help='Reset all installation status')
args = parser.parse_args()
if args.reset_installs:
reset_all_installs()
if args.reset_personal_path:
LollmsPaths.reset_configs()
if args.reset_config:
cfg_path = LollmsPaths.find_paths().personal_configuration_path / "local_config.yaml"
try:
cfg_path.unlink()
ASCIIColors.success("LOLLMS configuration reset successfully")
except:
ASCIIColors.success("Couldn't reset LOLLMS configuration")
# Configuration loading part
self.config = LOLLMSConfig.autoload(self.lollms_paths, args.config)
if args.binding_name:
self.config.binding_name = args.binding_name

View File

@ -2,6 +2,7 @@ from lollms.personality import AIPersonality, MSG_TYPE
from lollms.binding import LOLLMSConfig, LLMBinding
from lollms.helpers import ASCIIColors
from lollms.paths import LollmsPaths
from lollms import reset_all_installs
import shutil
import yaml
import importlib
@ -179,7 +180,7 @@ Participating personalities:
ASCIIColors.error(f"Binding returned this exception : {ex}")
ASCIIColors.error(f"{self.config.get_personality_path_infos()}")
print("Please select a valid model or install a new one from a url")
self.menu.select_model()
self.menu.select_personality()
self.cond_tk = self.personality.model.tokenize(self.personality.personality_conditioning)
self.n_cond_tk = len(self.cond_tk)
@ -241,10 +242,16 @@ def main():
parser.add_argument('--reset_personal_path', action='store_true', help='Reset the personal path')
parser.add_argument('--reset_config', action='store_true', help='Reset the configurations')
parser.add_argument('--reset_installs', action='store_true', help='Reset all installation status')
# Parse the command-line arguments
args = parser.parse_args()
if args.reset_installs:
reset_all_installs()
if args.reset_personal_path:
LollmsPaths.reset_configs()