Skip to content

Commit 196a26b

Browse files
Update code
1 parent 3f716d6 commit 196a26b

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

open_instruct/grpo_fast.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1282,10 +1282,9 @@ def train(
12821282
else:
12831283
with torch.no_grad():
12841284
if epoch_idx == 0:
1285-
if args.use_vllm_logprobs:
1286-
old_logprobs[i] = mb_vllm_logprobs
1287-
else:
1288-
old_logprobs[i] = mb_local_logprobs.detach()
1285+
old_logprobs[i] = (
1286+
mb_vllm_logprobs if args.use_vllm_logprobs else mb_local_logprobs.detach()
1287+
)
12891288
mb_old_logprobs = old_logprobs[i]
12901289

12911290
old_logprobs_mask = mb_old_logprobs != INVALID_LOGPROB

0 commit comments

Comments
 (0)