Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bug with passing capture_* args to neptune callback #29041

Merged
5 changes: 3 additions & 2 deletions src/transformers/integrations/integration_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
from .. import __version__ as version
from ..utils import flatten_dict, is_datasets_available, is_pandas_available, is_torch_available, logging


logger = logging.get_logger(__name__)

if is_torch_available():
Expand Down Expand Up @@ -1260,7 +1259,9 @@ def _initialize_run(self, **additional_neptune_kwargs):
self._stop_run_if_exists()

try:
self._run = init_run(**self._init_run_kwargs, **additional_neptune_kwargs)
run_params = additional_neptune_kwargs.copy()
run_params.update(self._init_run_kwargs)
self._run = init_run(**self._init_run_kwargs, **run_params)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks to me like it won't work. Because we're updating run_params with self._init_run_kwargs we're guaranteeing that all the keys in self._init_run_kwargs are in run_params i.e. we're passing the same argument twice to init_run, which I'd expect to trigger an error.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, you are absolutely correct!. In fact, it should be just **run_params in the init_run call. My bad! Fixing rn :) Thank you for noticing

self._run_id = self._run["sys/id"].fetch()
except (NeptuneMissingProjectNameException, NeptuneMissingApiTokenException) as e:
raise NeptuneMissingConfiguration() from e
Expand Down