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))), dim=0).indices.
|
135 |
progress_dummy_output = ''
|
136 |
elem_classes = [['bubble', 'even_bubble' if i % 2 == 0 else 'odd_bubble'] +
|
137 |
([] if i in important_idxs else ['faded_bubble']) for i in range(len(generation_texts))]
|
|
|
131 |
generation_texts = tokenizer.batch_decode(generated)
|
132 |
|
133 |
# create GUI output
|
134 |
+
important_idxs = 1 + interpreted_vectors.squeeze().diff(dim=0).topk(k=int(np.ceil(0.2 * len(generation_texts))), dim=0).indices.cpu().numpy()
|
135 |
progress_dummy_output = ''
|
136 |
elem_classes = [['bubble', 'even_bubble' if i % 2 == 0 else 'odd_bubble'] +
|
137 |
([] if i in important_idxs else ['faded_bubble']) for i in range(len(generation_texts))]
|