Rename progress bar types

This commit is contained in:
shademe 2022-12-16 11:58:52 +01:00
parent 93ba4e72fa
commit 41ec44d99a
No known key found for this signature in database
GPG Key ID: 6FCA9FC635B2A402
2 changed files with 6 additions and 6 deletions

View File

@ -40,7 +40,7 @@ def console_logger(
output_file (Optional[Union[str, Path]]): The file to save the training logs to. output_file (Optional[Union[str, Path]]): The file to save the training logs to.
""" """
return console_logger_v3( return console_logger_v3(
progress_bar=None if progress_bar is False else "eval_steps", progress_bar=None if progress_bar is False else "eval",
console_output=console_output, console_output=console_output,
output_file=output_file, output_file=output_file,
) )
@ -54,8 +54,8 @@ def console_logger_v3(
): ):
"""The ConsoleLogger.v3 prints out training logs in the console and/or saves them to a jsonl file. """The ConsoleLogger.v3 prints out training logs in the console and/or saves them to a jsonl file.
progress_bar (Optional[str]): Type of progress bar to show in the console. Allowed values: progress_bar (Optional[str]): Type of progress bar to show in the console. Allowed values:
all_steps - Tracks the number of steps until `training.max_steps` is reached. train - Tracks the number of steps from the beginning of training until the full training run is complete (training.max_steps is reached).
eval_steps - Tracks the number of steps until `training.eval_frequency` is reached. eval - Tracks the number of steps between the previous and next evaluation (training.eval_frequency is reached).
console_output (bool): Whether the logger should print the logs on the console. console_output (bool): Whether the logger should print the logs on the console.
output_file (Optional[Union[str, Path]]): The file to save the training logs to. output_file (Optional[Union[str, Path]]): The file to save the training logs to.
""" """
@ -107,7 +107,7 @@ def console_logger_v3(
write(msg.row(table_header, widths=table_widths, spacing=spacing)) write(msg.row(table_header, widths=table_widths, spacing=spacing))
write(msg.row(["-" * width for width in table_widths], spacing=spacing)) write(msg.row(["-" * width for width in table_widths], spacing=spacing))
progress = None progress = None
expected_progress_types = ("all_steps", "eval_steps", None) expected_progress_types = ("train", "eval", None)
if progress_bar not in expected_progress_types: if progress_bar not in expected_progress_types:
raise ValueError( raise ValueError(
Errors.E1048.format( Errors.E1048.format(
@ -172,7 +172,7 @@ def console_logger_v3(
) )
if progress_bar: if progress_bar:
# Set disable=None, so that it disables on non-TTY # Set disable=None, so that it disables on non-TTY
if progress_bar == "all_steps": if progress_bar == "train":
total = max_steps total = max_steps
desc = f"Last Eval Epoch: {info['epoch']}" desc = f"Last Eval Epoch: {info['epoch']}"
initial = info["step"] initial = info["step"]

View File

@ -587,7 +587,7 @@ saves them to a `jsonl` file.
| Name | Description | | Name | Description |
| ---------------- | ---------------------------------------------------------------------------------------------------------------------------------- | | ---------------- | ---------------------------------------------------------------------------------------------------------------------------------- |
| `progress_bar` | Type of progress bar to show in the console: `all_steps` or `eval_steps` | | `progress_bar` | Type of progress bar to show in the console: `train` or `eval` |
| | They track the number of steps until `training.max_steps` and `training.eval_frequency` are reached respectively.~~Optional[str]~~ | | | They track the number of steps until `training.max_steps` and `training.eval_frequency` are reached respectively.~~Optional[str]~~ |
| `console_output` | Whether the logger should print the logs in the console.~~bool~~ | | `console_output` | Whether the logger should print the logs in the console.~~bool~~ |
| `output_file` | The file to save the training logs to. ~~Optional[Union[str, Path]]~~ | | `output_file` | The file to save the training logs to. ~~Optional[Union[str, Path]]~~ |