Skip to content

Commit

Permalink
Hotfix from_step_attribution for decoder self-attention
Browse files Browse the repository at this point in the history
  • Loading branch information
gsarti committed Jan 17, 2024
1 parent f434192 commit 09c8481
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion inseq/data/attribution.py
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ def from_step_attributions(
out_seq_scores = [attr.sequence_scores[seq_score_name][i, ...] for i in range(num_sequences)]
else:
out_seq_scores = get_sequences_from_batched_steps(
[att.sequence_scores[seq_score_name] for att in attributions], padding_dims=[2], stack_dim=3
[att.sequence_scores[seq_score_name] for att in attributions], padding_dims=[1]
)
for seq_id in range(num_sequences):
seq_scores[seq_id][seq_score_name] = remove_pad_fn(out_seq_scores, sources, targets, seq_id)
Expand Down

0 comments on commit 09c8481

Please sign in to comment.