mirror of
https://github.com/KoboldAI/KoboldAI-Client.git
synced 2025-06-05 21:59:24 +02:00
Added flask-compress to speed up initial page load time
Added check for tokenizer not being loaded early enough and crashing javascript (not needed until user interaction) Removed unneeded CSS and JS files from web page load
This commit is contained in:
@@ -494,6 +494,7 @@ from flask import Flask, render_template, Response, request, copy_current_reques
|
||||
from flask_socketio import SocketIO, emit, join_room, leave_room
|
||||
from flask_socketio import emit as _emit
|
||||
from flask_session import Session
|
||||
from flask_compress import Compress
|
||||
import secrets
|
||||
from werkzeug.exceptions import HTTPException, NotFound, InternalServerError
|
||||
import secrets
|
||||
@@ -501,6 +502,7 @@ app = Flask(__name__, root_path=os.getcwd())
|
||||
app.secret_key = secrets.token_hex()
|
||||
app.config['SESSION_TYPE'] = 'filesystem'
|
||||
app.config['TEMPLATES_AUTO_RELOAD'] = True
|
||||
Compress(app)
|
||||
socketio = SocketIO(app, async_method="eventlet", manage_session=False, cors_allowed_origins='*', max_http_buffer_size=10_000_000)
|
||||
#socketio = SocketIO(app, async_method="eventlet", manage_session=False, cors_allowed_origins='*', max_http_buffer_size=10_000_000, logger=logger, engineio_logger=True)
|
||||
logger.add(UI_2_log_history, serialize=True, colorize=True, enqueue=True, level="INFO")
|
||||
|
@@ -31,4 +31,5 @@ dependencies:
|
||||
- accelerate
|
||||
- flask-session
|
||||
- python-socketio[client]
|
||||
- ansi2html
|
||||
- ansi2html
|
||||
- flask_compress
|
@@ -30,3 +30,4 @@ dependencies:
|
||||
- transformers>=4.20.1
|
||||
- accelerate
|
||||
- ansi2html
|
||||
- flask_compress
|
||||
|
@@ -19,4 +19,5 @@ loguru
|
||||
Pillow
|
||||
diffusers
|
||||
psutil
|
||||
ansi2html
|
||||
ansi2html
|
||||
flask_compress
|
@@ -23,4 +23,5 @@ loguru
|
||||
Pillow
|
||||
diffusers
|
||||
psutil
|
||||
ansi2html
|
||||
ansi2html
|
||||
flask_compress
|
@@ -2511,7 +2511,11 @@ function autoResize(element) {
|
||||
}
|
||||
|
||||
function token_length(text) {
|
||||
return encode(text).length;
|
||||
if (typeof encode === 'function') {
|
||||
return encode(text).length;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
function calc_token_usage() {
|
||||
|
@@ -14,8 +14,8 @@
|
||||
<link rel="stylesheet" href="static/bootstrap-toggle.min.css">
|
||||
<link rel="stylesheet" href="static/bootstrap.min.css">
|
||||
<script src="static/jquery-3.6.0.min.js"></script>
|
||||
<script src="static/jquery-ui.sortable.min.js"></script>
|
||||
<script src="static/bootstrap.min.js"></script>
|
||||
<!--<script src="static/jquery-ui.sortable.min.js"></script>-->
|
||||
<!--<script src="static/bootstrap.min.js"></script>-->
|
||||
<<script src="static/bootstrap-toggle.min.js"></script>
|
||||
<script src="static/socket.io.min.js"></script>
|
||||
<title>KoboldAI Client</title>
|
||||
@@ -23,7 +23,7 @@
|
||||
<link href="themes/Monochrome.css" rel="stylesheet" id="CSSTheme">
|
||||
<link href="static/koboldai.css" rel="stylesheet">
|
||||
<script src="static/koboldai.js"></script>
|
||||
<script src="static/favicon.js"></script>
|
||||
<script defer src="static/favicon.js"></script>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
</head>
|
||||
<body>
|
||||
|
Reference in New Issue
Block a user