Update rl_replacements.py
This commit is contained in:
parent
bc8af1191d
commit
56c17900ca
1 changed files with 1 additions and 0 deletions
|
|
@ -263,6 +263,7 @@ def grpo_trainer__get_per_token_logps(function_name, function):
|
|||
# We add 1 to `logits_to_keep` because the last logits of the sequence is later excluded
|
||||
hidden_states = model(input_ids=input_ids, attention_mask=attention_mask, logits_to_keep=logits_to_keep + 1).logits
|
||||
#logits = logits[:, :-1, :] # (B, L-1, V), exclude the last logit: it corresponds to the next token pred
|
||||
print("##############", hidden_states.shape)
|
||||
return hidden_states
|
||||
# input_ids = input_ids[:, -logits_to_keep:]
|
||||
# For transformers<=4.48, logits_to_keep argument isn't supported, so here we drop logits ourselves.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue