amirali1985 commited on
Commit
4bce7d7
·
verified ·
1 Parent(s): a526428

Upload folder using huggingface_hub

Browse files
Files changed (1) hide show
  1. app.py +11 -7
app.py CHANGED
@@ -179,10 +179,10 @@ def build_comparison_table(models, arch_filter="All", enriched_only=True):
179
 
180
 
181
  def build_detailed_splits(models, model_name):
182
- """Build full per-split table for a specific model."""
183
  for m in models:
184
  name = m["subfolder"].removeprefix("non_enriched/")
185
- if name == model_name:
186
  cfg = m["config"]
187
  eval_key = "sorl_eval" if cfg.get("mode") == "sorl" else "sft_eval"
188
  ev = m["metrics"].get(eval_key, {})
@@ -284,7 +284,7 @@ activation-level probing or SAEs needed. This is what we test on
284
  )
285
 
286
  with gr.Accordion("Per-Split Detail (select model)", open=False):
287
- model_selector = gr.Textbox(label="Model name (e.g. add_sub_sorl_abs10_K1_25K)", value="")
288
  detail_btn = gr.Button("Show splits")
289
  detail_table = gr.Dataframe(headers=["Split", "Accuracy", "N"], interactive=False)
290
 
@@ -417,21 +417,25 @@ found via activation-level analysis as explicit, interpretable tokens.
417
  hard_base = ["Ops", "Data", "Arch", "Config"] if "Arch" in df.columns else ["Ops", "Data", "Config"]
418
  hard_df = df[hard_base + hard_cols] if len(df) > 0 else pd.DataFrame()
419
 
420
- return models, summary, q_status, main_df, hard_df, eval_info
 
 
 
 
421
 
422
  def on_detail(models, name):
423
- return build_detailed_splits(models, name.strip())
424
 
425
  refresh_btn.click(
426
  on_refresh,
427
  inputs=[arch_filter],
428
- outputs=[models_state, summary_text, queue_status, main_table, hard_table, eval_info_md],
429
  )
430
 
431
  arch_filter.change(
432
  on_refresh,
433
  inputs=[arch_filter],
434
- outputs=[models_state, summary_text, queue_status, main_table, hard_table, eval_info_md],
435
  )
436
 
437
  detail_btn.click(on_detail, inputs=[models_state, model_selector], outputs=[detail_table])
 
179
 
180
 
181
  def build_detailed_splits(models, model_name):
182
+ """Build full per-split table for a specific model. Fuzzy match on subfolder name."""
183
  for m in models:
184
  name = m["subfolder"].removeprefix("non_enriched/")
185
+ if model_name in name or name in model_name or name == model_name:
186
  cfg = m["config"]
187
  eval_key = "sorl_eval" if cfg.get("mode") == "sorl" else "sft_eval"
188
  ev = m["metrics"].get(eval_key, {})
 
284
  )
285
 
286
  with gr.Accordion("Per-Split Detail (select model)", open=False):
287
+ model_selector = gr.Dropdown(label="Model", choices=[], allow_custom_value=True)
288
  detail_btn = gr.Button("Show splits")
289
  detail_table = gr.Dataframe(headers=["Split", "Accuracy", "N"], interactive=False)
290
 
 
417
  hard_base = ["Ops", "Data", "Arch", "Config"] if "Arch" in df.columns else ["Ops", "Data", "Config"]
418
  hard_df = df[hard_base + hard_cols] if len(df) > 0 else pd.DataFrame()
419
 
420
+ # Populate model dropdown
421
+ model_names = sorted([m["subfolder"].removeprefix("non_enriched/") for m in models])
422
+ model_dd = gr.Dropdown(choices=model_names, value=model_names[0] if model_names else "")
423
+
424
+ return models, summary, q_status, main_df, hard_df, eval_info, model_dd
425
 
426
  def on_detail(models, name):
427
+ return build_detailed_splits(models, name.strip() if name else "")
428
 
429
  refresh_btn.click(
430
  on_refresh,
431
  inputs=[arch_filter],
432
+ outputs=[models_state, summary_text, queue_status, main_table, hard_table, eval_info_md, model_selector],
433
  )
434
 
435
  arch_filter.change(
436
  on_refresh,
437
  inputs=[arch_filter],
438
+ outputs=[models_state, summary_text, queue_status, main_table, hard_table, eval_info_md, model_selector],
439
  )
440
 
441
  detail_btn.click(on_detail, inputs=[models_state, model_selector], outputs=[detail_table])