mirror of
https://github.com/ParisNeo/lollms.git
synced 2024-12-19 20:57:58 +00:00
upgraded
This commit is contained in:
parent
d9c265170c
commit
6f583fe316
@ -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()
|
||||
|
@ -141,10 +141,14 @@ Date: {{date}}
|
||||
self.personality_package_path = None
|
||||
return
|
||||
else:
|
||||
if is_relative_path:
|
||||
self.personality_package_path = self.lollms_paths.personalities_zoo_path/personality_package_path
|
||||
parts = personality_package_path.split("/")
|
||||
if parts[0]=="Custom personalities":
|
||||
self.personality_package_path = self.lollms_paths.custom_personalities_path/parts[1]
|
||||
else:
|
||||
self.personality_package_path = Path(personality_package_path)
|
||||
if is_relative_path:
|
||||
self.personality_package_path = self.lollms_paths.personalities_zoo_path/personality_package_path
|
||||
else:
|
||||
self.personality_package_path = Path(personality_package_path)
|
||||
|
||||
# Validate that the path exists
|
||||
if not self.personality_package_path.exists():
|
||||
|
@ -318,13 +318,20 @@ 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}")
|
||||
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"]
|
||||
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]
|
||||
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 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():
|
||||
languages = [f.stem for f in langs_dir.iterdir()]
|
||||
print("Select language")
|
||||
|
Loading…
Reference in New Issue
Block a user