dar-tau commited on
Commit
e3769dd
1 Parent(s): d3eb5d2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -3
app.py CHANGED
@@ -139,9 +139,8 @@ def run_interpretation(raw_original_prompt, raw_interpretation_prompt, max_new_t
139
 
140
  # try identifying important layers
141
  vectors_to_compare = interpreted_vectors # torch.tensor(global_state.sentence_transformer.encode(generation_texts))
142
- # layers that are usually never important
143
- avoid_first_exclusive, avoid_last = 3, 1
144
- vectors_to_compare = vectors_to_compare[avoid_first_exclusive:-avoid_last]
145
  diff_score = F.normalize(vectors_to_compare, dim=-1).diff(dim=0).norm(dim=-1)
146
  important_idxs = avoid_first_exclusive + diff_score.topk(k=int(np.ceil(0.1 * len(generation_texts)))).indices.cpu().numpy()
147
 
 
139
 
140
  # try identifying important layers
141
  vectors_to_compare = interpreted_vectors # torch.tensor(global_state.sentence_transformer.encode(generation_texts))
142
+ avoid_first, avoid_last = 2, 1 # layers that are usually never important
143
+ vectors_to_compare = vectors_to_compare[avoid_first:-avoid_last]
 
144
  diff_score = F.normalize(vectors_to_compare, dim=-1).diff(dim=0).norm(dim=-1)
145
  important_idxs = avoid_first_exclusive + diff_score.topk(k=int(np.ceil(0.1 * len(generation_texts)))).indices.cpu().numpy()
146