From 6fbfee9e6d904a8e1491e36afaca80d4e020f9d5 Mon Sep 17 00:00:00 2001 From: oobabooga <112222186+oobabooga@users.noreply.github.com> Date: Sun, 29 Jan 2023 12:05:18 -0300 Subject: [PATCH] Remove some bloat --- server.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/server.py b/server.py index b634a625..0d19b740 100644 --- a/server.py +++ b/server.py @@ -274,7 +274,6 @@ def create_extensions_block(): update_extensions_parameters(*default_values) btn_extensions = gr.Button("Apply") btn_extensions.click(update_extensions_parameters, [*extensions_ui_elements], []) - return extensions_ui_elements, btn_extensions def get_available_models(): return sorted(set([item.replace('.pt', '') for item in map(lambda x : str(x.name), list(Path('models/').glob('*'))+list(Path('torch-dumps/').glob('*'))) if not item.endswith('.txt')]), key=str.lower) @@ -661,7 +660,7 @@ if args.chat or args.cai_chat: upload_img_tavern = gr.File(type='binary') if args.extensions is not None: - extensions_ui_elements, btn_extensions = create_extensions_block() + create_extensions_block() input_params = [textbox, length_slider, preset_menu, model_menu, name1, name2, context, check, history_size_slider] if args.cai_chat: @@ -719,7 +718,7 @@ elif args.notebook: create_refresh_button(preset_menu, lambda : None, lambda : {"choices": get_available_presets()}, "refresh-button") if args.extensions is not None: - extensions_ui_elements, btn_extensions = create_extensions_block() + create_extensions_block() gen_event = buttons["Generate"].click(generate_reply, [textbox, length_slider, preset_menu, model_menu], [textbox, markdown, html], show_progress=args.no_stream, api_name="textgen") gen_event2 = textbox.submit(generate_reply, [textbox, length_slider, preset_menu, model_menu], [textbox, markdown, html], show_progress=args.no_stream) @@ -745,7 +744,7 @@ else: with gr.Column(): buttons["Stop"] = gr.Button("Stop") if args.extensions is not None: - extensions_ui_elements, btn_extensions = create_extensions_block() + create_extensions_block() with gr.Column(): with gr.Tab('Raw'):