huzey commited on
Commit
f7efa0a
1 Parent(s): e76863d

fix layer UI info

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -918,18 +918,18 @@ def make_parameters_section(is_lisa=False):
918
  if model_name == "LISSL(xinlai/LISSL-7B-v1)":
919
  layer_names = ["dec_0_input", "dec_0_attn", "dec_0_block", "dec_1_input", "dec_1_attn", "dec_1_block"]
920
  default_layer = "dec_1_block"
921
- return (gr.Slider(1, 6, step=1, label="LISA decoder: Layer index", value=6, elem_id="layer", visible=False),
922
  gr.Dropdown(layer_names, label="LISA decoder: Layer and Node", value=default_layer, elem_id="node_type"))
923
 
924
  layer_dict = LAYER_DICT
925
  if model_name in layer_dict:
926
  value = layer_dict[model_name]
927
- return (gr.Slider(1, value, step=1, label="Backbone: Layer index", value=value, elem_id="layer", visible=True),
928
  gr.Dropdown(["attn: attention output", "mlp: mlp output", "block: sum of residual"], label="Backbone: Layer type", value="block: sum of residual", elem_id="node_type", info="which feature to take from each layer?"))
929
  else:
930
  value = 12
931
- return (gr.Dropdown(["attn: attention output", "mlp: mlp output", "block: sum of residual"], label="Backbone: Layer type", value="block: sum of residual", elem_id="node_type", info="which feature to take from each layer?"),
932
- gr.Slider(1, value, step=1, label="Backbone: Layer index", value=value, elem_id="layer", visible=True))
933
  model_dropdown.change(fn=change_layer_slider, inputs=model_dropdown, outputs=[layer_slider, node_type_dropdown])
934
 
935
  def change_prompt_text(model_name):
 
918
  if model_name == "LISSL(xinlai/LISSL-7B-v1)":
919
  layer_names = ["dec_0_input", "dec_0_attn", "dec_0_block", "dec_1_input", "dec_1_attn", "dec_1_block"]
920
  default_layer = "dec_1_block"
921
+ return (gr.Slider(1, 6, step=1, label="LISA decoder: Layer index", value=6, elem_id="layer", visible=False, info=""),
922
  gr.Dropdown(layer_names, label="LISA decoder: Layer and Node", value=default_layer, elem_id="node_type"))
923
 
924
  layer_dict = LAYER_DICT
925
  if model_name in layer_dict:
926
  value = layer_dict[model_name]
927
+ return (gr.Slider(1, value, step=1, label="Backbone: Layer index", value=value, elem_id="layer", visible=True, info=""),
928
  gr.Dropdown(["attn: attention output", "mlp: mlp output", "block: sum of residual"], label="Backbone: Layer type", value="block: sum of residual", elem_id="node_type", info="which feature to take from each layer?"))
929
  else:
930
  value = 12
931
+ return (gr.Slider(1, value, step=1, label="Backbone: Layer index", value=value, elem_id="layer", visible=True, info=""),
932
+ gr.Dropdown(["attn: attention output", "mlp: mlp output", "block: sum of residual"], label="Backbone: Layer type", value="block: sum of residual", elem_id="node_type", info="which feature to take from each layer?"))
933
  model_dropdown.change(fn=change_layer_slider, inputs=model_dropdown, outputs=[layer_slider, node_type_dropdown])
934
 
935
  def change_prompt_text(model_name):