dar-tau commited on
Commit
8326344
·
verified ·
1 Parent(s): 8e5b8b3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -131,7 +131,7 @@ def run_interpretation(raw_original_prompt, raw_interpretation_prompt, max_new_t
131
  generation_texts = tokenizer.batch_decode(generated)
132
 
133
  # create GUI output
134
- important_idxs = 1 + interpreted_vectors.diff(dim=0).topk(k=int(np.ceil(0.2 * len(generation_texts))), dim=0).indices.cpu().numpy()
135
  print(f'{important_idxs=}')
136
  progress_dummy_output = ''
137
  elem_classes = [['bubble', 'even_bubble' if i % 2 == 0 else 'odd_bubble'] +
 
131
  generation_texts = tokenizer.batch_decode(generated)
132
 
133
  # create GUI output
134
+ important_idxs = 1 + interpreted_vectors.diff(dim=0).norm(dim=-1).topk(k=int(np.ceil(0.2 * len(generation_texts)))).indices.cpu().numpy()
135
  print(f'{important_idxs=}')
136
  progress_dummy_output = ''
137
  elem_classes = [['bubble', 'even_bubble' if i % 2 == 0 else 'odd_bubble'] +