Skip to content

Commit

Permalink
more nice doc
Browse files Browse the repository at this point in the history
  • Loading branch information
qgallouedec committed Jan 22, 2025
1 parent 91948b1 commit 7dd8c4c
Showing 1 changed file with 16 additions and 8 deletions.
24 changes: 16 additions & 8 deletions trl/trainer/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -992,14 +992,16 @@ class OnPolicyConfig(TrainingArguments):
Number of debugging samples generations (i.e., `generate_completions` calls) throughout training.
response_length (`int`, *optional*, defaults to `53`):
Length of the response.
stop_token (`str` or `None`, *optional*, defaults to `None`):
Specifies the token at which truncation should stop:
- `None`: No truncation is applied.
- `"eos"`: Uses the tokenizer's `eos_token` as the stop token.
stop_token (`str` or `None`, *optional*, defaults to `None`):
Specifies the stop token to use for text generation. This parameter is mutually exclusive with
`stop_token_id`.
- `None`: No stop token is applied, unless `stop_token_id` is specified.
- `'eos'`: Uses the tokenizer's `eos_token`.
stop_token_id (`int` or `None`, *optional*, defaults to `None`):
Truncation token id.
Specifies the ID of the stop token to use for text generation. If `None`, stop token ID is applied, unless
`stop_token` is specified. This parameter is mutually exclusive with `stop_token`.
temperature (`float`, *optional*, defaults to `0.7`):
Sampling temperature.
missing_eos_penalty (`float` or `None`, *optional*, defaults to `None`):
Expand Down Expand Up @@ -1058,11 +1060,17 @@ class OnPolicyConfig(TrainingArguments):
)
stop_token: Optional[Literal["eos"]] = field(
default=None,
metadata={"help": "Stop token."},
metadata={
"help": "Specifies the stop token to use for text generation. This parameter is mutually exclusive with "
"`stop_token_id`."
},
)
stop_token_id: Optional[int] = field(
default=None,
metadata={"help": "Truncation token id."},
metadata={
"help": "Specifies the ID of the stop token to use for text generation. If `None`, stop token ID is "
"applied, unless `stop_token` is specified. This parameter is mutually exclusive with `stop_token`."
},
)
temperature: float = field(
default=0.7,
Expand Down

0 comments on commit 7dd8c4c

Please sign in to comment.