This commit is contained in:
saloui 2023-05-30 14:11:30 +02:00
parent 50ab1f3817
commit 4113fd559a
3 changed files with 7 additions and 7 deletions

View File

@ -285,7 +285,7 @@ class DiscussionsDB:
discussion = {"id": discussion_id, "title": discussion_title, "messages": []}
# Insert discussion into the database
self.insert("INSERT INTO discussion (id, title) VALUES (?, ?)", (discussion_id, discussion_title))
discussion_id = self.insert("INSERT INTO discussion (title) VALUES (?)", (discussion_title,))
for message_data in messages_data:
sender = message_data.get("sender")

8
app.py
View File

@ -248,8 +248,8 @@ class Gpt4AllWebUI(GPT4AllAPI):
return jsonify(discussions)
def import_multiple_discussions(self):
data = request.get_json()
discussions = data
discussions = request.get_json()["jArray"]
self.db.import_from_json(discussions)
return jsonify(discussions)
def reset(self):
@ -317,8 +317,8 @@ class Gpt4AllWebUI(GPT4AllAPI):
else:
personality_info['avatar'] = ""
personalities[language_folder.name][category_folder.name].append(personality_info)
except:
print(f"Couldn't load personality from {personality_folder}")
except Exception as ex:
print(f"Couldn't load personality from {personality_folder} [{ex}]")
return json.dumps(personalities)
def get_personality():

View File

@ -35,8 +35,8 @@ class LLAMACPP(LLMBinding):
"""
super().__init__(config, False)
seed = config["seed"]
if seed <=0:
seed = random.randint(1, 2**31)
# if seed <=0:
# seed = random.randint(1, 2**31)
if not "n_gpu_layers" in self.config:
self.config["n_gpu_layers"] = 20