Skip to content

Commit

Permalink
Ignore Attn computation
Browse files Browse the repository at this point in the history
  • Loading branch information
pomonam committed Jul 10, 2024
1 parent 7374ddd commit c6efd69
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions examples/openwebtext/task.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,12 @@ def compute_measurement(
def get_influence_tracked_modules(self) -> List[str]:
total_modules = []

for i in range(32):
total_modules.append(f"model.layers.{i}.self_attn.q_proj")
total_modules.append(f"model.layers.{i}.self_attn.k_proj")
total_modules.append(f"model.layers.{i}.self_attn.v_proj")
total_modules.append(f"model.layers.{i}.self_attn.o_proj")
# You can uncomment the following lines if you would like to compute influence also on attention layers.
# for i in range(32):
# total_modules.append(f"model.layers.{i}.self_attn.q_proj")
# total_modules.append(f"model.layers.{i}.self_attn.k_proj")
# total_modules.append(f"model.layers.{i}.self_attn.v_proj")
# total_modules.append(f"model.layers.{i}.self_attn.o_proj")

for i in range(32):
total_modules.append(f"model.layers.{i}.mlp.gate_proj")
Expand Down

0 comments on commit c6efd69

Please sign in to comment.