Skip to content

Commit

Permalink
🔌 Fix type hint in LogCompletionsCallback (#2285)
Browse files Browse the repository at this point in the history
* Update callbacks.py for fix small python type error

* Update callbacks.py

---------

Co-authored-by: Quentin Gallouédec <[email protected]>
  • Loading branch information
anch0vy and qgallouedec authored Oct 28, 2024
1 parent e155cb8 commit 0ce3b65
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions trl/trainer/callbacks.py
Original file line number Diff line number Diff line change
Expand Up @@ -364,18 +364,18 @@ class LogCompletionsCallback(WandbCallback):
column containing the prompts for generating completions.
generation_config (`GenerationConfig`, *optional*):
The generation config to use for generating completions.
num_prompts (`int`, *optional*):
num_prompts (`int` or `None`, *optional*):
The number of prompts to generate completions for. If not provided, defaults to the number of examples in the evaluation dataset.
freq (`int`, *optional*):
freq (`int` or `None`, *optional*):
The frequency at which to log completions. If not provided, defaults to the trainer's `eval_steps`.
"""

def __init__(
self,
trainer: Trainer,
generation_config: Optional[GenerationConfig] = None,
num_prompts: int = None,
freq: int = None,
num_prompts: Optional[int] = None,
freq: Optional[int] = None,
):
super().__init__()
self.trainer = trainer
Expand Down

0 comments on commit 0ce3b65

Please sign in to comment.