mirror of
https://github.com/ParisNeo/lollms.git
synced 2024-12-18 20:27:58 +00:00
upgraded
This commit is contained in:
parent
8b4c5128b0
commit
0c4bdedcc7
@ -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()
|
||||
|
@ -116,6 +116,12 @@ class LLMBinding:
|
||||
the model
|
||||
"""
|
||||
return None
|
||||
|
||||
def destroy_model(self):
|
||||
"""
|
||||
destroys the current model
|
||||
"""
|
||||
pass
|
||||
|
||||
def install(self):
|
||||
"""
|
||||
|
@ -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.")
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user