Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -84,8 +84,6 @@ def rollout(attentions, discard_ratio, head_fusion, num_prefix_tokens=1):
|
|
84 |
# Discard the lowest attentions, but don't discard the prefix tokens
|
85 |
flat = attention_heads_fused.view(-1)
|
86 |
_, indices = flat.topk(int(flat.size(-1 )* discard_ratio), -1, False)
|
87 |
-
print(indices)
|
88 |
-
print(indices.shape)
|
89 |
indices = indices[indices >= num_prefix_tokens]
|
90 |
flat[indices] = 0
|
91 |
|
|
|
84 |
# Discard the lowest attentions, but don't discard the prefix tokens
|
85 |
flat = attention_heads_fused.view(-1)
|
86 |
_, indices = flat.topk(int(flat.size(-1 )* discard_ratio), -1, False)
|
|
|
|
|
87 |
indices = indices[indices >= num_prefix_tokens]
|
88 |
flat[indices] = 0
|
89 |
|