Skip to content

Commit 352175e

Browse files
chore: merge single use declarations
1 parent ae4c880 commit 352175e

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/forge/util/ops.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,10 +131,9 @@ def compute_logprobs_parallel(
131131
return compute_logprobs(logits.full_tensor(), target_ids, temperature, align)
132132

133133
local_logits = logits._local_tensor # [batch, seq_len, vocab_size / tp_size]
134-
target_len = target_ids.size(1)
135134

136135
if align:
137-
local_logits = local_logits[:, -target_len - 1 : -1, :]
136+
local_logits = local_logits[:, -target_ids.size(1) - 1 : -1, :]
138137

139138
target_ids = target_ids.to(local_logits.device)
140139
local_logits_fp32 = local_logits.float() / temperature

0 commit comments

Comments
 (0)