dar-tau commited on
Commit
9ab090f
·
verified ·
1 Parent(s): d27ec51

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -149,10 +149,10 @@ def run_interpretation(raw_original_prompt, raw_interpretation_prompt, max_new_t
149
  diff_score = ((diff_score1 - diff_score1.min()) / (diff_score1.max() - diff_score1.min())
150
  + (diff_score2 - diff_score2.min()) / (diff_score2.max() - diff_score2.min()))
151
 
152
- avoid_first, avoid_last = 2, 1 # layers that are usually never important
153
  assert avoid_first >= 1 # due to .diff() we will not be able to compute a score for the first layer
154
  diff_score = diff_score[avoid_first-1:len(diff_score)-avoid_last]
155
- important_idxs = avoid_first + diff_score.topk(k=7).indices.cpu().numpy() # k=int(np.ceil(0.15 * len(generation_texts)))
156
 
157
  # create GUI output
158
  print(f'{important_idxs=}')
 
149
  diff_score = ((diff_score1 - diff_score1.min()) / (diff_score1.max() - diff_score1.min())
150
  + (diff_score2 - diff_score2.min()) / (diff_score2.max() - diff_score2.min()))
151
 
152
+ avoid_first, avoid_last = 3, 3 # layers that are usually never important
153
  assert avoid_first >= 1 # due to .diff() we will not be able to compute a score for the first layer
154
  diff_score = diff_score[avoid_first-1:len(diff_score)-avoid_last]
155
+ important_idxs = avoid_first + diff_score.topk(k=int(np.ceil(0.3 * len(diff_score)))).indices.cpu().numpy() #
156
 
157
  # create GUI output
158
  print(f'{important_idxs=}')