mirror of
https://github.com/oobabooga/text-generation-webui.git
synced 2024-11-21 23:57:58 +01:00
Add a "dark_theme" option to settings.json (#2288)
This commit is contained in:
parent
c5446ae0e2
commit
0f51b64bb3
@ -33,6 +33,7 @@ reload_inputs = [] # Parameters for reloading the chat interface
|
||||
need_restart = False
|
||||
|
||||
settings = {
|
||||
'dark_theme': False,
|
||||
'autoload_model': True,
|
||||
'max_new_tokens': 200,
|
||||
'max_new_tokens_min': 1,
|
||||
|
@ -968,7 +968,11 @@ def create_interface():
|
||||
shared.gradio['count_tokens'].click(count_tokens, shared.gradio['textbox'], shared.gradio['status'], show_progress=False)
|
||||
|
||||
shared.gradio['interface'].load(lambda: None, None, None, _js=f"() => {{{js}}}")
|
||||
if shared.settings['dark_theme']:
|
||||
shared.gradio['interface'].load(lambda: None, None, None, _js=f"() => document.getElementsByTagName('body')[0].classList.add('dark')")
|
||||
|
||||
shared.gradio['interface'].load(partial(ui.apply_interface_values, {}, use_persistent=True), None, [shared.gradio[k] for k in ui.list_interface_input_elements(chat=shared.is_chat())], show_progress=False)
|
||||
|
||||
# Extensions tabs
|
||||
extensions_module.create_extensions_tabs()
|
||||
|
||||
|
@ -1,4 +1,5 @@
|
||||
{
|
||||
"dark_theme": false,
|
||||
"autoload_model": true,
|
||||
"max_new_tokens": 200,
|
||||
"max_new_tokens_min": 1,
|
||||
|
Loading…
Reference in New Issue
Block a user