Skip to content

Commit 2327493

Browse files
authored
backward compatible initialization (#666)
## Summary <!--- This is a required section; please describe the main purpose of this proposed code change. ---> #662 initialized the argument in a way that is not compatible with python3.9 so changing it to a backward compatible initialization. This unblocks TRL PR huggingface/trl#3260 <!--- ## Details This is an optional section; is there anything specific that reviewers should be aware of? ---> ## Testing Done <!--- This is a required section; please describe how this change was tested. ---> <!-- Replace BLANK with your device type. For example, A100-80G-PCIe Complete the following tasks before sending your PR, and replace `[ ]` with `[x]` to indicate you have done them. --> - Hardware Type: <BLANK> - [ ] run `make test` to ensure correctness - [ ] run `make checkstyle` to ensure code style - [ ] run `make test-convergence` to ensure convergence
1 parent cdd8e74 commit 2327493

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/liger_kernel/chunked_loss/grpo_loss.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
from typing import Optional
2+
13
import torch
24

35
from liger_kernel.chunked_loss.fused_linear_ppo import LigerFusedLinearPPOBase
@@ -204,7 +206,7 @@ def __init__(
204206
epsilon_low: float = 0.2,
205207
epsilon_high: float = 0.2,
206208
loss_type: str = "bnpo",
207-
max_completion_length: int | None = None,
209+
max_completion_length: Optional[int] = None,
208210
temperature: float = 1.0,
209211
):
210212
"""

0 commit comments

Comments
 (0)