mirror of
https://github.com/ParisNeo/lollms.git
synced 2025-04-07 02:46:41 +00:00
Personality: allow lua, cs and pas files
This commit is contained in:
parent
ad1c1e0bb5
commit
d766d45ad2
@ -1,8 +1,8 @@
|
||||
"""
|
||||
project: lollms
|
||||
file: lollms_files_events.py
|
||||
file: lollms_files_events.py
|
||||
author: ParisNeo
|
||||
description:
|
||||
description:
|
||||
Events related to socket io personality events
|
||||
|
||||
"""
|
||||
@ -31,7 +31,7 @@ lollmsElfServer = LOLLMSElfServer.get_instance()
|
||||
|
||||
# ----------------------------------- events -----------------------------------------
|
||||
def add_events(sio:socketio):
|
||||
|
||||
|
||||
@sio.on('get_personality_files')
|
||||
def get_personality_files(sid, data):
|
||||
client_id = sid
|
||||
@ -39,11 +39,11 @@ def add_events(sio:socketio):
|
||||
|
||||
client.generated_text = ""
|
||||
client.cancel_generation = False
|
||||
|
||||
|
||||
try:
|
||||
lollmsElfServer.personality.setCallback(partial(lollmsElfServer.process_chunk,client_id = client_id))
|
||||
except Exception as ex:
|
||||
trace_exception(ex)
|
||||
trace_exception(ex)
|
||||
|
||||
import os
|
||||
import imghdr
|
||||
@ -51,7 +51,7 @@ def add_events(sio:socketio):
|
||||
|
||||
ALLOWED_EXTENSIONS = {
|
||||
'txt', 'csv', 'py', 'html', 'js', 'jpg', 'jpeg', 'png', 'gif', 'bmp', 'tiff', 'ico', 'svg', 'mp4', 'mp3', 'avi', 'mov',
|
||||
'doc', 'docx', 'ppt', 'pptx', 'xls', 'xlsx', 'pdf', 'js', "md", "json"
|
||||
'doc', 'docx', 'ppt', 'pptx', 'xls', 'xlsx', 'pdf', 'md', 'json', 'lua', 'cs', 'pas', 'ts'
|
||||
}
|
||||
|
||||
def allowed_file(filename):
|
||||
@ -101,7 +101,7 @@ def add_events(sio:socketio):
|
||||
if is_last_chunk:
|
||||
lollmsElfServer.success('File received and saved successfully')
|
||||
lollmsElfServer.ShowBlockingMessage(f"File received {file_path.name}.\nProcessing ...")
|
||||
|
||||
|
||||
if lollmsElfServer.personality.processor:
|
||||
result = lollmsElfServer.personality.processor.add_file(file_path, client, partial(lollmsElfServer.process_chunk, client_id=client_id))
|
||||
else:
|
||||
|
Loading…
x
Reference in New Issue
Block a user