Update rl_replacements.py
This commit is contained in:
parent
580842de0b
commit
6a8ebbac92
1 changed files with 2 additions and 1 deletions
|
|
@ -333,7 +333,8 @@ def grpo_trainer_compute_loss(function_name, function):
|
|||
if self.beta != 0.0:
|
||||
with torch.inference_mode(), model.disable_adapter():
|
||||
ref_per_token_logps = self._get_per_token_logps(model, input_ids, attention_mask, logits_to_keep)
|
||||
print("ref_per_token_logps Unsloth 320", ref_per_token_logps.shape)
|
||||
if ref_per_token_logps is not None:
|
||||
print("ref_per_token_logps Unsloth 320", ref_per_token_logps.shape)
|
||||
else:
|
||||
ref_per_token_logps = None
|
||||
# per_token_kl = torch.exp(ref_per_token_logps - per_token_logps) - (ref_per_token_logps - per_token_logps) - 1
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue