cdpearlman commited on
Commit
d79e359
·
1 Parent(s): fad2911

Fix ablation data missing input_ids: preserve from original activation data

Browse files
Files changed (1) hide show
  1. app.py +4 -0
app.py CHANGED
@@ -1681,6 +1681,10 @@ def run_head_ablation(n_clicks_list, selected_heads_list, activation_data, model
1681
  ablated_data['ablated_layer'] = layer_num
1682
  ablated_data['ablated_heads'] = selected_heads
1683
 
 
 
 
 
1684
  # Success message
1685
  heads_str = ', '.join([f"H{h}" for h in sorted(selected_heads)])
1686
  success_message = html.Div([
 
1681
  ablated_data['ablated_layer'] = layer_num
1682
  ablated_data['ablated_heads'] = selected_heads
1683
 
1684
+ # Preserve input_ids from original data if not present (prompt is unchanged)
1685
+ if 'input_ids' not in ablated_data and 'input_ids' in activation_data:
1686
+ ablated_data['input_ids'] = activation_data['input_ids']
1687
+
1688
  # Success message
1689
  heads_str = ', '.join([f"H{h}" for h in sorted(selected_heads)])
1690
  success_message = html.Div([