mirror of
https://github.com/ParisNeo/lollms-webui.git
synced 2025-04-13 22:02:58 +00:00
upgraded ui
This commit is contained in:
parent
2760de4a30
commit
a21ce0a06c
@ -1531,7 +1531,9 @@ class LoLLMsAPPI(LollmsApplication):
|
||||
return output
|
||||
|
||||
def start_message_generation(self, message, message_id, client_id, is_continue=False):
|
||||
|
||||
if self.personality is None:
|
||||
self.notify("Select a personality",False,None)
|
||||
return
|
||||
ASCIIColors.info(f"Text generation requested by client: {client_id}")
|
||||
# send the message to the bot
|
||||
print(f"Received message : {message.content}")
|
||||
|
14
app.py
14
app.py
@ -27,6 +27,7 @@ import traceback
|
||||
import webbrowser
|
||||
from pathlib import Path
|
||||
import os
|
||||
from lollms.utilities import AdvancedGarbageCollector
|
||||
|
||||
def run_update_script(args=None):
|
||||
update_script = Path(__file__).parent/"update_script.py"
|
||||
@ -811,8 +812,17 @@ class LoLLMsWebUI(LoLLMsAPPI):
|
||||
del self.binding
|
||||
|
||||
self.binding = None
|
||||
to_remove = []
|
||||
for per in self.mounted_personalities:
|
||||
per.model = None
|
||||
if per is not None:
|
||||
per.model = None
|
||||
else:
|
||||
to_remove.append(per)
|
||||
for per in to_remove:
|
||||
self.mounted_personalities.remove(per)
|
||||
if len(self.mounted_personalities)==0:
|
||||
self.config.personalities= ["generic/lollms"]
|
||||
self.mount_personality(0)
|
||||
gc.collect()
|
||||
self.binding = BindingBuilder().build_binding(self.config, self.lollms_paths)
|
||||
self.model = self.binding.build_model()
|
||||
@ -1457,6 +1467,8 @@ class LoLLMsWebUI(LoLLMsAPPI):
|
||||
ASCIIColors.info(f"- Reinstalling binding {data['name']}...")
|
||||
try:
|
||||
ASCIIColors.info("Unmounting binding and model")
|
||||
GG = AdvancedGarbageCollector()
|
||||
GG.safeHardCollect("binding", self)
|
||||
self.binding = None
|
||||
gc.collect()
|
||||
ASCIIColors.info("Reinstalling binding")
|
||||
|
Loading…
x
Reference in New Issue
Block a user