From 41ec44d99ae5a1abfb3980f27b896af999a82718 Mon Sep 17 00:00:00 2001 From: shademe Date: Fri, 16 Dec 2022 11:58:52 +0100 Subject: [PATCH] Rename progress bar types --- spacy/training/loggers.py | 10 +++++----- website/docs/api/top-level.md | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/spacy/training/loggers.py b/spacy/training/loggers.py index 1a282f5e3..ee2db2bc2 100644 --- a/spacy/training/loggers.py +++ b/spacy/training/loggers.py @@ -40,7 +40,7 @@ def console_logger( output_file (Optional[Union[str, Path]]): The file to save the training logs to. """ 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, 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. 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. - eval_steps - Tracks the number of steps until `training.eval_frequency` 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 - 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. 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(["-" * width for width in table_widths], spacing=spacing)) progress = None - expected_progress_types = ("all_steps", "eval_steps", None) + expected_progress_types = ("train", "eval", None) if progress_bar not in expected_progress_types: raise ValueError( Errors.E1048.format( @@ -172,7 +172,7 @@ def console_logger_v3( ) if progress_bar: # Set disable=None, so that it disables on non-TTY - if progress_bar == "all_steps": + if progress_bar == "train": total = max_steps desc = f"Last Eval Epoch: {info['epoch']}" initial = info["step"] diff --git a/website/docs/api/top-level.md b/website/docs/api/top-level.md index a86518735..fc30b086a 100644 --- a/website/docs/api/top-level.md +++ b/website/docs/api/top-level.md @@ -587,7 +587,7 @@ saves them to a `jsonl` file. | 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]~~ | | `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]]~~ |