mirror of
https://github.com/ParisNeo/lollms-webui.git
synced 2024-12-18 20:17:50 +00:00
Fixed export database
This commit is contained in:
parent
dba9e08005
commit
b96bea43f6
@ -584,6 +584,7 @@ class LoLLMsAPPI(LollmsApplication):
|
||||
|
||||
def prepare_reception(self):
|
||||
self.current_generated_text = ""
|
||||
self.nb_received_tokens = 0
|
||||
self.full_text = ""
|
||||
self.is_bot_text_started = False
|
||||
|
||||
@ -717,6 +718,8 @@ class LoLLMsAPPI(LollmsApplication):
|
||||
# Stream the generated text to the main process
|
||||
elif message_type == MSG_TYPE.MSG_TYPE_FULL:
|
||||
self.current_generated_text = chunk
|
||||
self.nb_received_tokens += 1
|
||||
ASCIIColors.green(f"Received {self.nb_received_tokens} tokens",end="\r",flush=True)
|
||||
self.socketio.emit('message', {
|
||||
'data': self.current_generated_text,
|
||||
'user_message_id':self.current_user_message_id,
|
||||
@ -767,6 +770,7 @@ class LoLLMsAPPI(LollmsApplication):
|
||||
|
||||
def _generate(self, prompt, n_predict=50, callback=None):
|
||||
self.current_generated_text = ""
|
||||
self.nb_received_tokens = 0
|
||||
if self.model is not None:
|
||||
ASCIIColors.info("warmup")
|
||||
if self.config["override_personality_model_parameters"]:
|
||||
|
24
api/db.py
24
api/db.py
@ -226,7 +226,7 @@ class DiscussionsDB:
|
||||
discussion_id = row[0]
|
||||
discussion_title = row[1]
|
||||
discussion = {"id": discussion_id, "title":discussion_title, "messages": []}
|
||||
rows = self.select(f"SELECT sender, content, message_type, rank, parent, binding, model, personality, created_at, finished_generating_at FROM message WHERE discussion_id=?",(discussion_id,))
|
||||
rows = self.select(f"SELECT sender, content, type, rank, parent, binding, model, personality, created_at, finished_generating_at FROM message WHERE discussion_id=?",(discussion_id,))
|
||||
for message_row in rows:
|
||||
sender = message_row[1]
|
||||
content = message_row[2]
|
||||
@ -258,18 +258,18 @@ class DiscussionsDB:
|
||||
discussion_id = row[0]
|
||||
discussion_title = row[1]
|
||||
discussion = {"id": discussion_id, "title":discussion_title, "messages": []}
|
||||
rows = self.select(f"SELECT sender, content, message_type, rank, parent, binding, model, personality, created_at, finished_generating_at FROM message WHERE discussion_id=?",(discussion_id,))
|
||||
rows = self.select(f"SELECT sender, content, type, rank, parent, binding, model, personality, created_at, finished_generating_at FROM message WHERE discussion_id=?",(discussion_id,))
|
||||
for message_row in rows:
|
||||
sender = message_row[1]
|
||||
content = message_row[2]
|
||||
content_type = message_row[3]
|
||||
rank = message_row[4]
|
||||
parent = message_row[5]
|
||||
binding = message_row[6]
|
||||
model = message_row[7]
|
||||
personality = message_row[8]
|
||||
created_at = message_row[9]
|
||||
finished_generating_at = message_row[10]
|
||||
sender = message_row[0]
|
||||
content = message_row[1]
|
||||
content_type = message_row[2]
|
||||
rank = message_row[3]
|
||||
parent = message_row[4]
|
||||
binding = message_row[5]
|
||||
model = message_row[6]
|
||||
personality = message_row[7]
|
||||
created_at = message_row[8]
|
||||
finished_generating_at = message_row[9]
|
||||
|
||||
discussion["messages"].append(
|
||||
{"sender": sender, "content": content, "type": content_type, "rank": rank, "parent": parent, "binding": binding, "model":model, "personality":personality, "created_at":created_at, "finished_generating_at": finished_generating_at}
|
||||
|
10
app.py
10
app.py
@ -52,6 +52,7 @@ import logging
|
||||
import psutil
|
||||
from lollms.main_config import LOLLMSConfig
|
||||
from typing import Optional
|
||||
import gc
|
||||
|
||||
log = logging.getLogger('werkzeug')
|
||||
log.setLevel(logging.ERROR)
|
||||
@ -872,9 +873,18 @@ class LoLLMsWebUI(LoLLMsAPPI):
|
||||
return jsonify({"status":False, 'error':str(ex)})
|
||||
ASCIIColors.info(f"- Reinstalling binding {data['name']}...")
|
||||
try:
|
||||
ASCIIColors.info("Unmounting binding and model")
|
||||
self.binding = None
|
||||
self.model = None
|
||||
gc.collect()
|
||||
ASCIIColors.info("Reinstalling binding")
|
||||
self.binding = BindingBuilder().build_binding(self.config, self.lollms_paths, InstallOption.FORCE_INSTALL)
|
||||
ASCIIColors.info("Binding reinstalled successfully")
|
||||
|
||||
try:
|
||||
ASCIIColors.info("Reloading model")
|
||||
self.model = self.binding.build_model()
|
||||
ASCIIColors.info("Model reloaded successfully")
|
||||
except Exception as ex:
|
||||
print(f"Couldn't build model: [{ex}]")
|
||||
try:
|
||||
|
144
web/dist/assets/index-3ae5f636.js
vendored
144
web/dist/assets/index-3ae5f636.js
vendored
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
143
web/dist/assets/index-cff54d0e.js
vendored
Normal file
143
web/dist/assets/index-cff54d0e.js
vendored
Normal file
File diff suppressed because one or more lines are too long
4
web/dist/index.html
vendored
4
web/dist/index.html
vendored
@ -6,8 +6,8 @@
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>LoLLMS WebUI - Welcome</title>
|
||||
<script type="module" crossorigin src="/assets/index-3ae5f636.js"></script>
|
||||
<link rel="stylesheet" href="/assets/index-54172bba.css">
|
||||
<script type="module" crossorigin src="/assets/index-cff54d0e.js"></script>
|
||||
<link rel="stylesheet" href="/assets/index-8884f14a.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
|
Loading…
Reference in New Issue
Block a user