Update app.py
Browse files
app.py
CHANGED
@@ -131,6 +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.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'] +
|
@@ -228,7 +229,7 @@ with gr.Blocks(theme=gr.themes.Default(), css='styles.css') as demo:
|
|
228 |
btn.render()
|
229 |
|
230 |
progress_dummy = gr.Markdown('', elem_id='progress_dummy')
|
231 |
-
interpretation_bubbles = [gr.Textbox('',
|
232 |
for i in range(MAX_NUM_LAYERS)]
|
233 |
|
234 |
# event listeners
|
|
|
131 |
generation_texts = tokenizer.batch_decode(generated)
|
132 |
|
133 |
# create GUI output
|
134 |
+
print(f'{interpreted_vectors.size()=}\t\t{int(np.ceil(0.2 * len(generation_texts)))=}')
|
135 |
important_idxs = 1 + interpreted_vectors.squeeze().diff(dim=0).topk(k=int(np.ceil(0.2 * len(generation_texts))), dim=0).indices.cpu().numpy()
|
136 |
progress_dummy_output = ''
|
137 |
elem_classes = [['bubble', 'even_bubble' if i % 2 == 0 else 'odd_bubble'] +
|
|
|
229 |
btn.render()
|
230 |
|
231 |
progress_dummy = gr.Markdown('', elem_id='progress_dummy')
|
232 |
+
interpretation_bubbles = [gr.Textbox('', container=False, visible=False)
|
233 |
for i in range(MAX_NUM_LAYERS)]
|
234 |
|
235 |
# event listeners
|