mirror of
https://github.com/ParisNeo/lollms-webui.git
synced 2024-12-19 04:17:52 +00:00
bugfix
This commit is contained in:
parent
9a89cea00b
commit
09f353121f
@ -166,11 +166,13 @@ class LoLLMsAPPI(LollmsApplication):
|
||||
"processing":False,
|
||||
"schedule_for_deletion":False
|
||||
}
|
||||
self.socketio.emit('connected', room=request.sid)
|
||||
ASCIIColors.success(f'Client {request.sid} connected')
|
||||
|
||||
@socketio.on('disconnect')
|
||||
def disconnect():
|
||||
try:
|
||||
self.socketio.emit('disconnected', room=request.sid)
|
||||
if self.connections[request.sid]["processing"]:
|
||||
self.connections[request.sid]["schedule_for_deletion"]=True
|
||||
else:
|
||||
@ -893,6 +895,9 @@ class LoLLMsAPPI(LollmsApplication):
|
||||
if message_type == MSG_TYPE.MSG_TYPE_EXCEPTION:
|
||||
self.notify(chunk,False, client_id)
|
||||
ASCIIColors.error("--> Exception from personality:"+chunk)
|
||||
if message_type == MSG_TYPE.MSG_TYPE_WARNING:
|
||||
self.notify(chunk,True, client_id)
|
||||
ASCIIColors.error("--> Exception from personality:"+chunk)
|
||||
|
||||
if message_type == MSG_TYPE.MSG_TYPE_NEW_MESSAGE:
|
||||
self.nb_received_tokens = 0
|
||||
|
13
app.py
13
app.py
@ -56,10 +56,6 @@ try:
|
||||
from lollms.helpers import ASCIIColors, trace_exception
|
||||
from lollms.paths import LollmsPaths
|
||||
|
||||
import mimetypes
|
||||
mimetypes.add_type('application/javascript', '.js')
|
||||
mimetypes.add_type('text/css', '.css')
|
||||
|
||||
from api.db import Discussion
|
||||
from flask import (
|
||||
Flask,
|
||||
@ -90,6 +86,15 @@ except Exception as ex:
|
||||
print("Error importing some libraries. Updating lollms...")
|
||||
run_update_script()
|
||||
|
||||
|
||||
try:
|
||||
import mimetypes
|
||||
mimetypes.add_type('application/javascript', '.js')
|
||||
mimetypes.add_type('text/css', '.css')
|
||||
except:
|
||||
ASCIIColors.yellow("Couldn't set mimetype")
|
||||
|
||||
|
||||
log = logging.getLogger('werkzeug')
|
||||
log.setLevel(logging.ERROR)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user