Unverified Commit 8fb4d0e4 authored by Steven Liu's avatar Steven Liu Committed by GitHub
Browse files

Fix callback docstrings (#21005)

* fix callback docstrings

* format as markdown list

* apply feedback
parent b7417bee
...@@ -668,16 +668,16 @@ class WandbCallback(TrainerCallback): ...@@ -668,16 +668,16 @@ class WandbCallback(TrainerCallback):
variables: variables:
Environment: Environment:
WANDB_LOG_MODEL (`bool`, *optional*, defaults to `False`): - **WANDB_LOG_MODEL** (`bool`, *optional*, defaults to `False`):
Whether or not to log model as artifact at the end of training. Use along with Whether or not to log model as artifact at the end of training. Use along with
*TrainingArguments.load_best_model_at_end* to upload best model. [`~transformers.TrainingArguments.load_best_model_at_end`] to upload best model.
WANDB_WATCH (`str`, *optional* defaults to `"gradients"`): - **WANDB_WATCH** (`str`, *optional*, defaults to `gradients`):
Can be `"gradients"`, `"all"` or `"false"`. Set to `"false"` to disable gradient logging or `"all"` to Can be `gradients`, `all` or `false`. Set to `false` to disable gradient logging or `all` to log gradients
log gradients and parameters. and parameters.
WANDB_PROJECT (`str`, *optional*, defaults to `"huggingface"`): - **WANDB_PROJECT** (`str`, *optional*, defaults to `huggingface`):
Set this to a custom string to store results in a different project. Set this to a custom string to store results in a different project.
WANDB_DISABLED (`bool`, *optional*, defaults to `False`): - **WANDB_DISABLED** (`bool`, *optional*, defaults to `False`):
Whether or not to disable wandb entirely. Set *WANDB_DISABLED=true* to disable. Whether or not to disable wandb entirely. Set `WANDB_DISABLED=True` to disable.
""" """
if self._wandb is None: if self._wandb is None:
return return
...@@ -784,16 +784,16 @@ class CometCallback(TrainerCallback): ...@@ -784,16 +784,16 @@ class CometCallback(TrainerCallback):
Setup the optional Comet.ml integration. Setup the optional Comet.ml integration.
Environment: Environment:
COMET_MODE (`str`, *optional*): - **COMET_MODE** (`str`, *optional*, defaults to `ONLINE`):
Whether to create an online, offline experiment or disable Comet logging. Can be "OFFLINE", "ONLINE", Whether to create an online, offline experiment or disable Comet logging. Can be `OFFLINE`, `ONLINE`, or
or "DISABLED". Defaults to "ONLINE". `DISABLED`.
COMET_PROJECT_NAME (`str`, *optional*): - **COMET_PROJECT_NAME** (`str`, *optional*):
Comet project name for experiments Comet project name for experiments.
COMET_OFFLINE_DIRECTORY (`str`, *optional*): - **COMET_OFFLINE_DIRECTORY** (`str`, *optional*):
Folder to use for saving offline experiments when `COMET_MODE` is "OFFLINE" Folder to use for saving offline experiments when `COMET_MODE` is `OFFLINE`.
COMET_LOG_ASSETS (`str`, *optional*): - **COMET_LOG_ASSETS** (`str`, *optional*, defaults to `TRUE`):
Whether or not to log training assets (tf event logs, checkpoints, etc), to Comet. Can be "TRUE", or Whether or not to log training assets (tf event logs, checkpoints, etc), to Comet. Can be `TRUE`, or
"FALSE". Defaults to "TRUE". `FALSE`.
For a number of configurable items in the environment, see For a number of configurable items in the environment, see
[here](https://www.comet.ml/docs/python-sdk/advanced/#comet-configuration-variables). [here](https://www.comet.ml/docs/python-sdk/advanced/#comet-configuration-variables).
...@@ -892,28 +892,27 @@ class MLflowCallback(TrainerCallback): ...@@ -892,28 +892,27 @@ class MLflowCallback(TrainerCallback):
Setup the optional MLflow integration. Setup the optional MLflow integration.
Environment: Environment:
HF_MLFLOW_LOG_ARTIFACTS (`str`, *optional*): - **HF_MLFLOW_LOG_ARTIFACTS** (`str`, *optional*):
Whether to use MLflow .log_artifact() facility to log artifacts. This only makes sense if logging to a Whether to use MLflow `.log_artifact()` facility to log artifacts. This only makes sense if logging to a
remote server, e.g. s3 or GCS. If set to `True` or *1*, will copy each saved checkpoint on each save in remote server, e.g. s3 or GCS. If set to `True` or *1*, will copy each saved checkpoint on each save in
[`TrainingArguments`]'s `output_dir` to the local or remote artifact storage. Using it without a remote [`TrainingArguments`]'s `output_dir` to the local or remote artifact storage. Using it without a remote
storage will just copy the files to your artifact location. storage will just copy the files to your artifact location.
MLFLOW_EXPERIMENT_NAME (`str`, *optional*): - **MLFLOW_EXPERIMENT_NAME** (`str`, *optional*, defaults to `None`):
Whether to use an MLflow experiment_name under which to launch the run. Default to "None" which will Whether to use an MLflow experiment_name under which to launch the run. Default to `None` which will point
point to the "Default" experiment in MLflow. Otherwise, it is a case sensitive name of the experiment to the `Default` experiment in MLflow. Otherwise, it is a case sensitive name of the experiment to be
to be activated. If an experiment with this name does not exist, a new experiment with this name is activated. If an experiment with this name does not exist, a new experiment with this name is created.
created. - **MLFLOW_TAGS** (`str`, *optional*):
MLFLOW_TAGS (`str`, *optional*): A string dump of a dictionary of key/value pair to be added to the MLflow run as tags. Example:
A string dump of a dictionary of key/value pair to be added to the MLflow run as tags. Example: `os.environ['MLFLOW_TAGS']='{"release.candidate": "RC1", "release.version": "2.2.0"}'`.
os.environ['MLFLOW_TAGS']='{"release.candidate": "RC1", "release.version": "2.2.0"}' - **MLFLOW_NESTED_RUN** (`str`, *optional*):
MLFLOW_NESTED_RUN (`str`, *optional*): Whether to use MLflow nested runs. If set to `True` or *1*, will create a nested run inside the current
Whether to use MLflow nested runs. If set to `True` or *1*, will create a nested run inside the current run.
run. - **MLFLOW_RUN_ID** (`str`, *optional*):
MLFLOW_RUN_ID (`str`, *optional*): Allow to reattach to an existing run which can be usefull when resuming training from a checkpoint. When
Allow to reattach to an existing run which can be usefull when resuming training from a checkpoint. `MLFLOW_RUN_ID` environment variable is set, `start_run` attempts to resume a run with the specified run ID
When MLFLOW_RUN_ID environment variable is set, start_run attempts to resume a run with the specified and other parameters are ignored.
run ID and other parameters are ignored. - **MLFLOW_FLATTEN_PARAMS** (`str`, *optional*, defaults to `False`):
MLFLOW_FLATTEN_PARAMS (`str`, *optional*): Whether to flatten the parameters dictionary before logging.
Whether to flatten the parameters dictionary before logging. Default to `False`.
""" """
self._log_artifacts = os.getenv("HF_MLFLOW_LOG_ARTIFACTS", "FALSE").upper() in ENV_VARS_TRUE_VALUES self._log_artifacts = os.getenv("HF_MLFLOW_LOG_ARTIFACTS", "FALSE").upper() in ENV_VARS_TRUE_VALUES
self._nested_run = os.getenv("MLFLOW_NESTED_RUN", "FALSE").upper() in ENV_VARS_TRUE_VALUES self._nested_run = os.getenv("MLFLOW_NESTED_RUN", "FALSE").upper() in ENV_VARS_TRUE_VALUES
...@@ -1310,10 +1309,10 @@ class ClearMLCallback(TrainerCallback): ...@@ -1310,10 +1309,10 @@ class ClearMLCallback(TrainerCallback):
A [`TrainerCallback`] that sends the logs to [ClearML](https://clear.ml/). A [`TrainerCallback`] that sends the logs to [ClearML](https://clear.ml/).
Environment: Environment:
CLEARML_PROJECT (`str`, *optional*, defaults to `"HuggingFace Transformers"`): - **CLEARML_PROJECT** (`str`, *optional*, defaults to `HuggingFace Transformers`):
ClearML project name. ClearML project name.
CLEARML_TASK (`str`, *optional* defaults to `"Trainer"`): - **CLEARML_TASK** (`str`, *optional*, defaults to `Trainer`):
ClearML task name. ClearML task name.
""" """
def __init__(self): def __init__(self):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment