mirror of
https://github.com/ParisNeo/lollms-webui.git
synced 2025-02-21 17:36:39 +00:00
upgraded code and zoos
This commit is contained in:
parent
f7cf00f07e
commit
2064113330
@ -1324,6 +1324,21 @@ class LoLLMsAPPI(LollmsApplication):
|
|||||||
):
|
):
|
||||||
self.connections[client_id]["current_discussion"].current_message.finished_generating_at=datetime.now().strftime('%Y-%m-%d %H:%M:%S')
|
self.connections[client_id]["current_discussion"].current_message.finished_generating_at=datetime.now().strftime('%Y-%m-%d %H:%M:%S')
|
||||||
mtdt = json.dumps(metadata, indent=4) if metadata is not None and type(metadata)== list else metadata
|
mtdt = json.dumps(metadata, indent=4) if metadata is not None and type(metadata)== list else metadata
|
||||||
|
if self.nb_received_tokens==1 and msg_type==MSG_TYPE.MSG_TYPE_CHUNK:
|
||||||
|
self.socketio.emit('update_message', {
|
||||||
|
"sender": self.personality.name,
|
||||||
|
'id':self.connections[client_id]["current_discussion"].current_message.id,
|
||||||
|
'content': "✍ warming up ...",# self.connections[client_id]["generated_text"],
|
||||||
|
'ui': ui,
|
||||||
|
'discussion_id':self.connections[client_id]["current_discussion"].discussion_id,
|
||||||
|
'message_type': MSG_TYPE.MSG_TYPE_STEP_END.value,
|
||||||
|
'finished_generating_at': self.connections[client_id]["current_discussion"].current_message.finished_generating_at,
|
||||||
|
'parameters':parameters,
|
||||||
|
'metadata':metadata
|
||||||
|
}, room=client_id
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
self.socketio.emit('update_message', {
|
self.socketio.emit('update_message', {
|
||||||
"sender": self.personality.name,
|
"sender": self.personality.name,
|
||||||
'id':self.connections[client_id]["current_discussion"].current_message.id,
|
'id':self.connections[client_id]["current_discussion"].current_message.id,
|
||||||
@ -1432,7 +1447,7 @@ class LoLLMsAPPI(LollmsApplication):
|
|||||||
if self.connections[client_id]["continuing"] and self.connections[client_id]["first_chunk"]:
|
if self.connections[client_id]["continuing"] and self.connections[client_id]["first_chunk"]:
|
||||||
self.update_message(client_id, self.connections[client_id]["generated_text"], parameters, metadata)
|
self.update_message(client_id, self.connections[client_id]["generated_text"], parameters, metadata)
|
||||||
else:
|
else:
|
||||||
self.update_message(client_id, chunk, parameters, metadata)
|
self.update_message(client_id, chunk, parameters, metadata, msg_type=MSG_TYPE.MSG_TYPE_CHUNK)
|
||||||
self.connections[client_id]["first_chunk"]=False
|
self.connections[client_id]["first_chunk"]=False
|
||||||
# if stop generation is detected then stop
|
# if stop generation is detected then stop
|
||||||
if not self.cancel_gen:
|
if not self.cancel_gen:
|
||||||
@ -1536,7 +1551,8 @@ class LoLLMsAPPI(LollmsApplication):
|
|||||||
self.connections[client_id]["current_discussion"].load_message(message_id)
|
self.connections[client_id]["current_discussion"].load_message(message_id)
|
||||||
self.connections[client_id]["generated_text"] = message.content
|
self.connections[client_id]["generated_text"] = message.content
|
||||||
else:
|
else:
|
||||||
self.new_message(client_id, self.personality.name, "✍ warming up ...")
|
self.new_message(client_id, self.personality.name, "")
|
||||||
|
self.update_message(client_id, "✍ warming up ...", msg_type=MSG_TYPE.MSG_TYPE_STEP_START)
|
||||||
self.socketio.sleep(0.01)
|
self.socketio.sleep(0.01)
|
||||||
|
|
||||||
# prepare query and reception
|
# prepare query and reception
|
||||||
|
17
app.py
17
app.py
@ -584,7 +584,24 @@ class LoLLMsWebUI(LoLLMsAPPI):
|
|||||||
elif language in ["bash","shell","cmd","powershell"]:
|
elif language in ["bash","shell","cmd","powershell"]:
|
||||||
return self.execute_bash(code, discussion_id, message_id)
|
return self.execute_bash(code, discussion_id, message_id)
|
||||||
return {"output": "Unsupported language", "execution_time": 0}
|
return {"output": "Unsupported language", "execution_time": 0}
|
||||||
|
|
||||||
|
def open_code_folder(self):
|
||||||
|
"""Executes Python code and returns the output."""
|
||||||
|
|
||||||
|
data = request.get_json()
|
||||||
|
code = data["code"]
|
||||||
|
discussion_id = data.get("discussion_id","unknown_discussion")
|
||||||
|
message_id = data.get("message_id","unknown_message")
|
||||||
|
language = data.get("language","python")
|
||||||
|
|
||||||
|
|
||||||
|
ASCIIColors.info("Opening folder:")
|
||||||
|
# Create a temporary file.
|
||||||
|
root_folder = self.lollms_paths.personal_outputs_path/"discussions"/f"d_{discussion_id}"
|
||||||
|
root_folder.mkdir(parents=True,exist_ok=True)
|
||||||
|
|
||||||
|
return {"output": "OK", "execution_time": 0}
|
||||||
|
|
||||||
def copy_files(self, src, dest):
|
def copy_files(self, src, dest):
|
||||||
for item in os.listdir(src):
|
for item in os.listdir(src):
|
||||||
src_file = os.path.join(src, item)
|
src_file = os.path.join(src, item)
|
||||||
|
@ -1 +1 @@
|
|||||||
Subproject commit 30e5c797a9864038fa20a2c78331208e0e0b74c2
|
Subproject commit 3d594c5c44a0931b71dc8d9923d72ec83d7b5f88
|
@ -2142,7 +2142,7 @@ export default {
|
|||||||
// Loading text
|
// Loading text
|
||||||
loading_text:"",
|
loading_text:"",
|
||||||
// Current personality category
|
// Current personality category
|
||||||
extension_category:"ai_sensors",
|
extension_category:"bound_extensions",
|
||||||
personality_category:null,
|
personality_category:null,
|
||||||
// install custom model
|
// install custom model
|
||||||
addModelDialogVisibility: false,
|
addModelDialogVisibility: false,
|
||||||
|
@ -1 +1 @@
|
|||||||
Subproject commit 809d67e735965399b67c727645bbbb750b85dd7e
|
Subproject commit 4972bcfd776d0ea1cc970502f001ccc7d1a8987a
|
@ -1 +1 @@
|
|||||||
Subproject commit d49695c67a89c6d707ba5a838986c3330b25d8a3
|
Subproject commit d4b3fc970a3261def5198895644479c895350fc1
|
@ -1 +1 @@
|
|||||||
Subproject commit 7737d1a3737467ff1b13e3824f54824a7b42be43
|
Subproject commit b3b69934aa8a9ac75511d1b8b0edba875a0cdc07
|
@ -1 +1 @@
|
|||||||
Subproject commit 28ee12d9684ea564f7b76c5fac89d235dc621893
|
Subproject commit a77c8f4f934ff97864dd8d21a7b0881a142a012d
|
Loading…
x
Reference in New Issue
Block a user