diff --git a/server.py b/server.py index 43cd062..c8cb0d3 100644 --- a/server.py +++ b/server.py @@ -229,6 +229,9 @@ def update_model_parameters(state, initial=False): elif element == 'cpu_memory' and value is not None: value = f"{value}MiB" + if element in ['pre_layer']: + value = [value] if value > 0 else None + setattr(shared.args, element, value) found_positive = False @@ -360,7 +363,7 @@ def create_model_menus(): with gr.Column(): shared.gradio['model_type'] = gr.Dropdown(label="model_type", choices=["None", "llama", "opt", "gptj"], value=shared.args.model_type or "None") - shared.gradio['pre_layer'] = gr.Slider(label="pre_layer", minimum=0, maximum=100, value=shared.args.pre_layer) + shared.gradio['pre_layer'] = gr.Slider(label="pre_layer", minimum=0, maximum=100, value=shared.args.pre_layer[0] if shared.args.pre_layer is not None else 0) with gr.Row(): with gr.Column():