Update app.py
Browse files
app.py
CHANGED
|
@@ -98,7 +98,7 @@ def get_hidden_states(raw_original_prompt, force_hidden_states=False):
|
|
| 98 |
# TODO: document this!
|
| 99 |
important_tokens = (1 +
|
| 100 |
F.normalize(hidden_states, dim=-1).diff(dim=0)
|
| 101 |
-
.norm(dim=-1).topk(k=
|
| 102 |
print(f'{important_tokens=}')
|
| 103 |
global_state.local_state.hidden_states = hidden_states.cpu().detach()
|
| 104 |
|
|
|
|
| 98 |
# TODO: document this!
|
| 99 |
important_tokens = (1 +
|
| 100 |
F.normalize(hidden_states, dim=-1).diff(dim=0)
|
| 101 |
+
.norm(dim=-1).topk(k=5).indices[:, 0].cpu().numpy())
|
| 102 |
print(f'{important_tokens=}')
|
| 103 |
global_state.local_state.hidden_states = hidden_states.cpu().detach()
|
| 104 |
|