Merge pull request #499 from ebolam/disable_model_load

Disable model load
This commit is contained in:
henk717 2024-01-10 22:45:12 +01:00 committed by GitHub
commit c760f72e5a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 10 additions and 3 deletions

View File

@ -1907,7 +1907,7 @@ def index():
if args.no_ui:
return redirect('/api/latest')
else:
return render_template('index.html', hide_ai_menu=args.noaimenu)
return render_template('index.html', hide_ai_menu=args.noaimenu or koboldai_vars.disable_model_load)
@app.route('/api', strict_slashes=False)
@require_allowed_ip
def api():

View File

@ -1253,7 +1253,8 @@ class system_settings(settings):
'lua_koboldcore', 'sp', 'sp_length', '_horde_pid', 'horde_share', 'aibusy',
'serverstarted', 'inference_config', 'image_pipeline', 'summarizer', 'on_colab'
'summary_tokenizer', 'use_colab_tpu', 'noai', 'disable_set_aibusy', 'cloudflare_link', 'tts_model',
'generating_image', 'bit_8_available', 'host', 'hascuda', 'usegpu', 'rng_states', 'comregex_ai', 'comregex_ui', 'git_repository', 'git_branch', 'colab_arg']
'generating_image', 'bit_8_available', 'host', 'hascuda', 'usegpu', 'rng_states', 'comregex_ai', 'comregex_ui', 'git_repository', 'git_branch', 'colab_arg',
'disable_model_load']
settings_name = "system"
def __init__(self, socketio, koboldai_var):
self._socketio = socketio
@ -1340,6 +1341,7 @@ class system_settings(settings):
self.seen_messages = []
self.git_repository = ""
self.git_branch = ""
self.disable_model_load = False
@dataclass

View File

@ -3592,6 +3592,11 @@ body.NotConnected {
display: none;
}
.settings_button[system_disable_model_load="true"] {
cursor: not-allowed;
pointer-events: none;
}
@font-face {
font-family: 'Material Icons Outlined';
font-style: normal;

View File

@ -39,7 +39,7 @@
</div>
<div style="display: flex; justify-content: center;">
{% if not hide_ai_menu %}
<button class="settings_button" onclick="socket.emit('load_model_button', {});">
<button class="settings_button var_sync_alt_system_disable_model_load" onclick="socket.emit('load_model_button', {});">
<span class="material-icons-outlined cursor" tooltip="Load Model" style="font-size: 1.4em;">folder_open</span>
<span class="button_label">Load Model</span>
</button>