diff --git a/docs/source/en/main_classes/callback.md b/docs/source/en/main_classes/callback.md index bc1413a94742..f25f4487a5f7 100644 --- a/docs/source/en/main_classes/callback.md +++ b/docs/source/en/main_classes/callback.md @@ -36,7 +36,6 @@ By default, `TrainingArguments.report_to` is set to `"all"`, so a [`Trainer`] wi - [`~integrations.WandbCallback`] if [wandb](https://www.wandb.com/) is installed. - [`~integrations.CometCallback`] if [comet_ml](https://www.comet.com/site/) is installed. - [`~integrations.MLflowCallback`] if [mlflow](https://www.mlflow.org/) is installed. -- [`~integrations.NeptuneCallback`] if [neptune](https://neptune.ai/) is installed. - [`~integrations.AzureMLCallback`] if [azureml-sdk](https://pypi.org/project/azureml-sdk/) is installed. - [`~integrations.CodeCarbonCallback`] if [codecarbon](https://pypi.org/project/codecarbon/) is @@ -84,8 +83,6 @@ Here is the list of the available [`TrainerCallback`] in the library: [[autodoc]] integrations.CodeCarbonCallback -[[autodoc]] integrations.NeptuneCallback - [[autodoc]] integrations.ClearMLCallback [[autodoc]] integrations.DagsHubCallback diff --git a/docs/source/ja/main_classes/callback.md b/docs/source/ja/main_classes/callback.md index f1cb357f7eb8..388bd7ff0f69 100644 --- a/docs/source/ja/main_classes/callback.md +++ b/docs/source/ja/main_classes/callback.md @@ -37,7 +37,6 @@ rendered properly in your Markdown viewer. - [`~integrations.WandbCallback`] [wandb](https://www.wandb.com/) がインストールされている場合。 - [`~integrations.CometCallback`] [comet_ml](https://www.comet.com/site/) がインストールされている場合。 - [mlflow](https://www.mlflow.org/) がインストールされている場合は [`~integrations.MLflowCallback`]。 -- [`~integrations.NeptuneCallback`] [neptune](https://neptune.ai/) がインストールされている場合。 - [`~integrations.AzureMLCallback`] [azureml-sdk](https://pypi.org/project/azureml-sdk/) の場合 インストールされています。 - [`~integrations.CodeCarbonCallback`] [codecarbon](https://pypi.org/project/codecarbon/) の場合 @@ -82,8 +81,6 @@ rendered properly in your Markdown viewer. [[autodoc]] integrations.CodeCarbonCallback -[[autodoc]] integrations.NeptuneCallback - [[autodoc]] integrations.ClearMLCallback [[autodoc]] integrations.DagsHubCallback diff --git a/docs/source/ko/main_classes/callback.md b/docs/source/ko/main_classes/callback.md index c8d122a8ef92..de3dd54ef7f7 100644 --- a/docs/source/ko/main_classes/callback.md +++ b/docs/source/ko/main_classes/callback.md @@ -36,7 +36,6 @@ rendered properly in your Markdown viewer. 사용됩니다. - [`~integrations.CometCallback`]는 [comet_ml](https://www.comet.com/site/)이 설치되어 있으면 사용됩니다. - [`~integrations.MLflowCallback`]는 [mlflow](https://www.mlflow.org/)가 설치되어 있으면 사용됩니다. -- [`~integrations.NeptuneCallback`]는 [neptune](https://neptune.ai/)이 설치되어 있으면 사용됩니다. - [`~integrations.AzureMLCallback`]는 [azureml-sdk](https://pypi.org/project/azureml-sdk/)가 설치되어 있으면 사용됩니다. - [`~integrations.CodeCarbonCallback`]는 [codecarbon](https://pypi.org/project/codecarbon/)이 설치되어 @@ -82,8 +81,6 @@ rendered properly in your Markdown viewer. [[autodoc]] integrations.CodeCarbonCallback -[[autodoc]] integrations.NeptuneCallback - [[autodoc]] integrations.ClearMLCallback [[autodoc]] integrations.DagsHubCallback diff --git a/docs/source/zh/main_classes/callback.md b/docs/source/zh/main_classes/callback.md index 36c1898f018b..b80d0da386f6 100644 --- a/docs/source/zh/main_classes/callback.md +++ b/docs/source/zh/main_classes/callback.md @@ -30,7 +30,6 @@ Callbacks是“只读”的代码片段,除了它们返回的[TrainerControl] - [`~integrations.WandbCallback`],如果安装了[wandb](https://www.wandb.com/)。 - [`~integrations.CometCallback`],如果安装了[comet_ml](https://www.comet.com/site/)。 - [`~integrations.MLflowCallback`],如果安装了[mlflow](https://www.mlflow.org/)。 -- [`~integrations.NeptuneCallback`],如果安装了[neptune](https://neptune.ai/)。 - [`~integrations.AzureMLCallback`],如果安装了[azureml-sdk](https://pypi.org/project/azureml-sdk/)。 - [`~integrations.CodeCarbonCallback`],如果安装了[codecarbon](https://pypi.org/project/codecarbon/)。 - [`~integrations.ClearMLCallback`],如果安装了[clearml](https://github.com/allegroai/clearml)。 @@ -71,8 +70,6 @@ Callbacks是“只读”的代码片段,除了它们返回的[TrainerControl] [[autodoc]] integrations.CodeCarbonCallback -[[autodoc]] integrations.NeptuneCallback - [[autodoc]] integrations.ClearMLCallback [[autodoc]] integrations.DagsHubCallback diff --git a/examples/pytorch/README.md b/examples/pytorch/README.md index c9f288ac36b6..77066900315b 100644 --- a/examples/pytorch/README.md +++ b/examples/pytorch/README.md @@ -199,7 +199,6 @@ You can easily log and monitor your runs code. The following are currently suppo * [TensorBoard](https://www.tensorflow.org/tensorboard) * [Weights & Biases](https://docs.wandb.ai/integrations/huggingface) * [Comet ML](https://www.comet.com/docs/v2/integrations/ml-frameworks/transformers/) -* [Neptune](https://docs.neptune.ai/integrations-and-supported-tools/model-training/hugging-face) * [ClearML](https://clear.ml/docs/latest/docs/getting_started/ds/ds_first_steps) * [DVCLive](https://dvc.org/doc/dvclive/ml-frameworks/huggingface) @@ -256,91 +255,6 @@ or if in a Conda environment: conda install -c comet_ml -c anaconda -c conda-forge comet_ml ``` -### Neptune - -First, install the Neptune client library. You can do it with either `pip` or `conda`: - -`pip`: - -```bash -pip install neptune -``` - -`conda`: - -```bash -conda install -c conda-forge neptune -``` - -Next, in your model training script, import `NeptuneCallback`: - -```python -from transformers.integrations import NeptuneCallback -``` - -To enable Neptune logging, in your `TrainingArguments`, set the `report_to` argument to `"neptune"`: - -```python -training_args = TrainingArguments( - "quick-training-distilbert-mrpc", - eval_strategy="steps", - eval_steps=20, - report_to="neptune", -) - -trainer = Trainer( - model, - training_args, - ... -) -``` - -**Note:** This method requires saving your Neptune credentials as environment variables (see the bottom of the section). - -Alternatively, for more logging options, create a Neptune callback: - -```python -neptune_callback = NeptuneCallback() -``` - -To add more detail to the tracked run, you can supply optional arguments to `NeptuneCallback`. - -Some examples: - -```python -neptune_callback = NeptuneCallback( - name = "DistilBERT", - description = "DistilBERT fine-tuned on GLUE/MRPC", - tags = ["args-callback", "fine-tune", "MRPC"], # tags help you manage runs in Neptune - base_namespace="callback", # the default is "finetuning" - log_checkpoints = "best", # other options are "last", "same", and None - capture_hardware_metrics = False, # additional keyword arguments for a Neptune run -) -``` - -Pass the callback to the Trainer: - -```python -training_args = TrainingArguments(..., report_to=None) -trainer = Trainer( - model, - training_args, - ... - callbacks=[neptune_callback], -) -``` - -Now, when you start the training with `trainer.train()`, your metadata will be logged in Neptune. - -**Note:** Although you can pass your **Neptune API token** and **project name** as arguments when creating the callback, the recommended way is to save them as environment variables: - -| Environment variable | Value | -| :------------------- | :--------------------------------------------------- | -| `NEPTUNE_API_TOKEN` | Your Neptune API token. To find and copy it, click your Neptune avatar and select **Get your API token**. | -| `NEPTUNE_PROJECT` | The full name of your Neptune project (`workspace-name/project-name`). To find and copy it, head to **project settings** → **Properties**. | - -For detailed instructions and examples, see the [Neptune docs](https://docs.neptune.ai/integrations/transformers/). - ### ClearML To use ClearML, install the clearml package with: diff --git a/src/transformers/integrations/integration_utils.py b/src/transformers/integrations/integration_utils.py index 29de72c05415..b89e6062ba7b 100755 --- a/src/transformers/integrations/integration_utils.py +++ b/src/transformers/integrations/integration_utils.py @@ -26,6 +26,7 @@ import shutil import sys import tempfile +import warnings from dataclasses import fields from enum import Enum from pathlib import Path @@ -1455,6 +1456,10 @@ def __init__(self): class NeptuneCallback(TrainerCallback): """TrainerCallback that sends the logs to [Neptune](https://app.neptune.ai). + > [!WARNING] + > Neptune integration is deprecated and will be removed in a future version of Transformers. We recommend using + > other supported experiment tracking integrations. + Args: api_token (`str`, *optional*): Neptune API token obtained upon registration. You can leave this argument out if you have saved your token to the `NEPTUNE_API_TOKEN` environment @@ -1500,6 +1505,11 @@ def __init__( log_checkpoints: str | None = None, **neptune_run_kwargs, ): + warnings.warn( + "The NeptuneCallback is deprecated and will be removed in a future version of Transformers. We recommend " + "using other supported experiment tracking integrations.", + FutureWarning, + ) if not is_neptune_available(): raise ValueError( "NeptuneCallback requires the Neptune client library to be installed. " diff --git a/src/transformers/training_args.py b/src/transformers/training_args.py index 963bed209ac5..09cb48cd7f74 100644 --- a/src/transformers/training_args.py +++ b/src/transformers/training_args.py @@ -596,9 +596,9 @@ class TrainingArguments: instance of `Dataset`. report_to (`str` or `list[str]`, *optional*, defaults to `"none"`): The list of integrations to report the results and logs to. Supported platforms are `"azure_ml"`, - `"clearml"`, `"codecarbon"`, `"comet_ml"`, `"dagshub"`, `"dvclive"`, `"flyte"`, `"mlflow"`, `"neptune"`, - `"swanlab"`, `"tensorboard"`, `"trackio"` and `"wandb"`. Use `"all"` to report to all integrations - installed, `"none"` for no integrations. + `"clearml"`, `"codecarbon"`, `"comet_ml"`, `"dagshub"`, `"dvclive"`, `"flyte"`, `"mlflow"`, `"swanlab"`, + `"tensorboard"`, `"trackio"` and `"wandb"`. Use `"all"` to report to all integrations installed, `"none"` + for no integrations. project (`str`, *optional*, defaults to `"huggingface"`): The name of the project to use for logging. Currently, only used by Trackio. trackio_space_id (`str` or `None`, *optional*, defaults to `"trackio"`): @@ -2386,8 +2386,8 @@ def set_logging( report_to (`str` or `list[str]`, *optional*, defaults to `"none"`): The list of integrations to report the results and logs to. Supported platforms are `"azure_ml"`, `"clearml"`, `"codecarbon"`, `"comet_ml"`, `"dagshub"`, `"dvclive"`, `"flyte"`, `"mlflow"`, - `"neptune"`, `"swanlab"`, `"tensorboard"`, `"trackio"` and `"wandb"`. Use `"all"` to report to all - integrations installed, `"none"` for no integrations. + `"swanlab"`, `"tensorboard"`, `"trackio"` and `"wandb"`. Use `"all"` to report to all integrations + installed, `"none"` for no integrations. first_step (`bool`, *optional*, defaults to `False`): Whether to log and evaluate the first `global_step` or not. nan_inf_filter (`bool`, *optional*, defaults to `True`):