Update app.py
Browse files
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)))
|
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'] +
|