This commit is contained in:
Saifeddine ALOUI 2023-10-19 23:43:44 +02:00
parent d9c265170c
commit 6f583fe316
4 changed files with 20 additions and 8 deletions

View File

@ -164,6 +164,7 @@ 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')
parser.add_argument('--default_cfg_path', type=str, default=None, help='Reset all installation status')
@ -177,7 +178,7 @@ def main():
LollmsPaths.reset_configs()
if args.reset_config:
lollms_paths = LollmsPaths.find_paths(tool_prefix="lollms_server_")
lollms_paths = LollmsPaths.find_paths(custom_default_cfg_path=args.default_cfg_path, tool_prefix="lollms_server_")
cfg_path = lollms_paths.personal_configuration_path / f"{lollms_paths.tool_prefix}local_config.yaml"
try:
cfg_path.unlink()

View File

@ -140,6 +140,10 @@ Date: {{date}}
self.assets_list = []
self.personality_package_path = None
return
else:
parts = personality_package_path.split("/")
if parts[0]=="Custom personalities":
self.personality_package_path = self.lollms_paths.custom_personalities_path/parts[1]
else:
if is_relative_path:
self.personality_package_path = self.lollms_paths.personalities_zoo_path/personality_package_path

View File

@ -318,11 +318,18 @@ class MainMenu(Menu):
if 1 <= choice <= len(personality_categories)-1:
category = personality_categories[choice - 1]
print(f"You selected category: {ASCIIColors.color_green}{category}{ASCIIColors.color_reset}")
if category == "Custom personalities":
personality_names = [p.stem for p in (self.lollms_app.lollms_paths.custom_personalities_path).iterdir() if p.is_dir() and not p.name.startswith(".")]+["Back"]
else:
personality_names = [p.stem for p in (self.lollms_app.lollms_paths.personalities_zoo_path/category).iterdir() if p.is_dir() and not p.name.startswith(".")]+["Back"]
print("Select personality")
choice = self.show_menu(personality_names)
if 1 <= choice <= len(personality_names)-1:
name = personality_names[choice - 1]
if category == "Custom personalities":
print(f"You selected personality: {ASCIIColors.color_green}{name}{ASCIIColors.color_reset}")
langs_dir = self.lollms_app.lollms_paths.custom_personalities_path/name/"languages"
else:
print(f"You selected personality: {ASCIIColors.color_green}{name}{ASCIIColors.color_reset}")
langs_dir = self.lollms_app.lollms_paths.personalities_zoo_path/category/name/"languages"
if langs_dir.exists():

View File

@ -26,7 +26,7 @@ def get_all_files(path):
setuptools.setup(
name="lollms",
version="5.8.7",
version="5.8.8",
author="Saifeddine ALOUI",
author_email="aloui.saifeddine@gmail.com",
description="A python library for AI personality definition",