Skip to content

Commit 379e9c8

Browse files
authored
Update rl_replacements.py
1 parent 5d2d3b2 commit 379e9c8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

‎unsloth_zoo/rl_replacements.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -316,8 +316,8 @@ def grpo_compute_loss(
316316
delta = delta * mask
317317
flat_is_ratio = importance_sampling_ratio * mask
318318
else:
319-
delta = torch.tensor([])
320-
flat_is_ratio = torch.tensor([])
319+
delta = torch.tensor([]).detach()
320+
flat_is_ratio = torch.tensor([]).detach()
321321
if beta != 0.0:
322322
loss_i = loss_i + beta * kl_i
323323

0 commit comments

Comments
 (0)