This commit is contained in:
Saifeddine ALOUI 2023-07-19 18:42:14 +02:00
parent 8b4c5128b0
commit 0c4bdedcc7
4 changed files with 15 additions and 6 deletions

View File

@ -10,7 +10,7 @@ from lollms.terminal import MainMenu
import subprocess
class LollmsApplication:
def __init__(self, app_name:str, config:LOLLMSConfig, lollms_paths:LollmsPaths, load_binding=True, load_model=True) -> None:
def __init__(self, app_name:str, config:LOLLMSConfig, lollms_paths:LollmsPaths, load_binding=True, load_model=True, try_select_binding=False, try_select_model=False) -> None:
"""
Creates a LOLLMS Application
"""
@ -36,7 +36,10 @@ class LollmsApplication:
if self.config.binding_name is None:
ASCIIColors.warning(f"No binding selected")
ASCIIColors.info("Please select a valid model or install a new one from a url")
self.menu.select_binding()
if try_select_binding:
self.menu.select_binding()
else:
self.binding=None
if load_binding:
try:
self.binding = self.load_binding()

View File

@ -116,6 +116,12 @@ class LLMBinding:
the model
"""
return None
def destroy_model(self):
"""
destroys the current model
"""
pass
def install(self):
"""

View File

@ -876,7 +876,7 @@ class StateMachine:
def process_state(self, command, callback=None):
def process_state(self, command, full_context, callback=None):
"""
Process the given command based on the current state.
@ -895,12 +895,12 @@ class StateMachine:
for cmd, func in commands.items():
if cmd == command[0:len(cmd)]:
func(command)
func(command, full_context)
return
default_func = current_state.get("default")
if default_func is not None:
default_func(command)
default_func(command, full_context)
else:
raise ValueError(f"Command '{command}' not found in current state and no default function defined.")

View File

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