mirror of
https://github.com/ParisNeo/lollms-webui.git
synced 2025-06-22 08:50:08 +00:00
few bugfixes
This commit is contained in:
4
app.py
4
app.py
@ -302,7 +302,7 @@ class Gpt4AllWebUI(GPT4AllAPI):
|
|||||||
print("New backend selected")
|
print("New backend selected")
|
||||||
self.config["backend"]=data['setting_value']
|
self.config["backend"]=data['setting_value']
|
||||||
|
|
||||||
backend_, model_ =self.process.rebuild_model(self.config)
|
backend_ =self.process.rebuild_backend(self.config)
|
||||||
models = backend_.list_models(self.config)
|
models = backend_.list_models(self.config)
|
||||||
if len(models)>0:
|
if len(models)>0:
|
||||||
self.backend = backend_
|
self.backend = backend_
|
||||||
@ -589,7 +589,7 @@ class Gpt4AllWebUI(GPT4AllAPI):
|
|||||||
save_config(self.config, self.config_file_path)
|
save_config(self.config, self.config_file_path)
|
||||||
|
|
||||||
self.process.set_config(self.config)
|
self.process.set_config(self.config)
|
||||||
self.backend, self.model = self.process.rebuild_model()
|
self.backend = self.process.rebuild_backend()
|
||||||
|
|
||||||
print("==============================================")
|
print("==============================================")
|
||||||
print("Parameters changed to:")
|
print("Parameters changed to:")
|
||||||
|
@ -84,23 +84,15 @@ class ModelProcess:
|
|||||||
def clear_queue(self):
|
def clear_queue(self):
|
||||||
self.clear_queue_queue.put(('clear_queue',))
|
self.clear_queue_queue.put(('clear_queue',))
|
||||||
|
|
||||||
def rebuild_model(self, config):
|
def rebuild_backend(self, config):
|
||||||
try:
|
try:
|
||||||
backend = self.load_backend(Path("backends")/config["backend"])
|
backend = self.load_backend(Path("backends")/config["backend"])
|
||||||
print("Backend loaded successfully")
|
print("Backend loaded successfully")
|
||||||
try:
|
|
||||||
model = backend(config)
|
|
||||||
print("Model created successfully")
|
|
||||||
except Exception as ex:
|
|
||||||
print("Couldn't build model")
|
|
||||||
print(ex)
|
|
||||||
model = None
|
|
||||||
except Exception as ex:
|
except Exception as ex:
|
||||||
print("Couldn't build backend")
|
print("Couldn't build backend")
|
||||||
print(ex)
|
print(ex)
|
||||||
backend = None
|
backend = None
|
||||||
model = None
|
return backend
|
||||||
return backend, model
|
|
||||||
|
|
||||||
def _rebuild_model(self):
|
def _rebuild_model(self):
|
||||||
try:
|
try:
|
||||||
@ -257,7 +249,7 @@ class GPT4AllAPI():
|
|||||||
self.process.start()
|
self.process.start()
|
||||||
self.config = config
|
self.config = config
|
||||||
|
|
||||||
self.backend, self.model = self.process.rebuild_model(self.config)
|
self.backend = self.process.rebuild_backend(self.config)
|
||||||
self.personality = self.process.rebuild_personality()
|
self.personality = self.process.rebuild_personality()
|
||||||
if config["debug"]:
|
if config["debug"]:
|
||||||
print(print(f"{self.personality}"))
|
print(print(f"{self.personality}"))
|
||||||
@ -442,7 +434,7 @@ class GPT4AllAPI():
|
|||||||
timestamp = datetime.now().strftime("%Y-%m-%d %H:%M:%S")
|
timestamp = datetime.now().strftime("%Y-%m-%d %H:%M:%S")
|
||||||
|
|
||||||
# Chatbot conditionning
|
# Chatbot conditionning
|
||||||
self.condition_chatbot(self.personality.personality_conditioning)
|
self.condition_chatbot()
|
||||||
return timestamp
|
return timestamp
|
||||||
|
|
||||||
def prepare_query(self, message_id=-1):
|
def prepare_query(self, message_id=-1):
|
||||||
|
@ -86,7 +86,7 @@ export default {
|
|||||||
handleSelection() {
|
handleSelection() {
|
||||||
if (this.isInstalled && !this.selected) {
|
if (this.isInstalled && !this.selected) {
|
||||||
this.onSelected(this);
|
this.onSelected(this);
|
||||||
this.selected=true;
|
this.$set(this, 'selected', true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user