Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions trl/models/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ def setup_chat_format(
format: Optional[Literal["chatml"]] = "chatml",
resize_to_multiple_of: Optional[int] = None,
) -> tuple[PreTrainedModel, PreTrainedTokenizer]:
# docstyle-ignore
"""
Setup chat format by adding special tokens to the tokenizer, setting the correct format, and extending the
embedding layer of the model based on the new special tokens.
Expand Down
1 change: 1 addition & 0 deletions trl/trainer/judges.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ def judge(


class PairRMJudge(BasePairwiseJudge):
# docstyle-ignore
"""
LLM judge based on the PairRM model from AllenAI.

Expand Down
2 changes: 2 additions & 0 deletions trl/trainer/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,7 @@ def ensure_master_addr_port(addr: Optional[str] = None, port: Optional[int] = No

@dataclass
class RewardDataCollatorWithPadding:
# docstyle-ignore
r"""
Reward DataCollator class that pads the inputs to the maximum length of the batch.

Expand Down Expand Up @@ -1251,6 +1252,7 @@ def empty_cache() -> None:


def decode_and_strip_padding(inputs: torch.Tensor, tokenizer: PreTrainedTokenizerBase) -> list[str]:
# docstyle-ignore
"""
Decodes the input tensor and strips the padding tokens.

Expand Down
Loading