From d364aa0a3c0993b09d53966b53eae862f4deaae0 Mon Sep 17 00:00:00 2001 From: oobabooga <112222186+oobabooga@users.noreply.github.com> Date: Tue, 1 Oct 2024 10:22:57 -0700 Subject: [PATCH 1/3] Lint --- js/main.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/js/main.js b/js/main.js index 71489f14e3..3028afac1f 100644 --- a/js/main.js +++ b/js/main.js @@ -604,11 +604,11 @@ headerBar.addEventListener("click", (e) => { // Add a confirmation dialog when leaving the page // Useful to avoid data loss //------------------------------------------------ -window.addEventListener('beforeunload', function (event) { +window.addEventListener("beforeunload", function (event) { // Cancel the event event.preventDefault(); // Chrome requires returnValue to be set - event.returnValue = ''; + event.returnValue = ""; }); moveToChatTab(); From 93c250b9b6b7d625c9cd698f99400d4fe650779d Mon Sep 17 00:00:00 2001 From: oobabooga <112222186+oobabooga@users.noreply.github.com> Date: Tue, 1 Oct 2024 11:16:15 -0700 Subject: [PATCH 2/3] Add a UI element for enable_tp --- modules/loaders.py | 2 ++ modules/ui.py | 1 + modules/ui_model_menu.py | 1 + 3 files changed, 4 insertions(+) diff --git a/modules/loaders.py b/modules/loaders.py index 16a3106e94..deee00a7f9 100644 --- a/modules/loaders.py +++ b/modules/loaders.py @@ -90,6 +90,7 @@ 'cache_8bit', 'cache_4bit', 'autosplit', + 'enable_tp', 'alpha_value', 'compress_pos_emb', 'trust_remote_code', @@ -105,6 +106,7 @@ 'cache_8bit', 'cache_4bit', 'autosplit', + 'enable_tp', 'alpha_value', 'compress_pos_emb', 'exllamav2_info', diff --git a/modules/ui.py b/modules/ui.py index 76b1c009c4..c07beeb466 100644 --- a/modules/ui.py +++ b/modules/ui.py @@ -90,6 +90,7 @@ def list_model_elements(): 'cache_8bit', 'cache_4bit', 'autosplit', + 'enable_tp', 'threads', 'threads_batch', 'n_batch', diff --git a/modules/ui_model_menu.py b/modules/ui_model_menu.py index 1883fdca4e..f87b680aeb 100644 --- a/modules/ui_model_menu.py +++ b/modules/ui_model_menu.py @@ -136,6 +136,7 @@ def create_ui(): shared.gradio['disk'] = gr.Checkbox(label="disk", value=shared.args.disk) shared.gradio['bf16'] = gr.Checkbox(label="bf16", value=shared.args.bf16) shared.gradio['autosplit'] = gr.Checkbox(label="autosplit", value=shared.args.autosplit, info='Automatically split the model tensors across the available GPUs.') + shared.gradio['enable_tp'] = gr.Checkbox(label="enable_tp", value=shared.args.enable_tp, info='Enable Tensor Parallelism (TP).') shared.gradio['no_flash_attn'] = gr.Checkbox(label="no_flash_attn", value=shared.args.no_flash_attn) shared.gradio['no_xformers'] = gr.Checkbox(label="no_xformers", value=shared.args.no_xformers) shared.gradio['no_sdpa'] = gr.Checkbox(label="no_sdpa", value=shared.args.no_sdpa) From 49dfa0adaf52bcff76b3ab9c33326812b281c2cf Mon Sep 17 00:00:00 2001 From: oobabooga <112222186+oobabooga@users.noreply.github.com> Date: Tue, 1 Oct 2024 11:20:48 -0700 Subject: [PATCH 3/3] Fix the "save preset" event --- modules/ui_file_saving.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/ui_file_saving.py b/modules/ui_file_saving.py index ac72c62316..3a27e1b957 100644 --- a/modules/ui_file_saving.py +++ b/modules/ui_file_saving.py @@ -74,7 +74,7 @@ def handle_save_preset_confirm_click(filename, contents): try: utils.save_file(f"presets/{filename}.yaml", contents) available_presets = utils.get_available_presets() - output = gr.update(choices=available_presets, value=filename), + output = gr.update(choices=available_presets, value=filename) except Exception: output = gr.update() traceback.print_exc()