mirror of
https://github.com/huggingface/transformers.git
synced 2025-07-31 02:02:21 +06:00
Neptune fix bug init run (#22836)
* [neptune] fix checkpoint bug with relative out_dir * update imports * reformat with black * check neptune without imports * fix typing-related issue * run black on code * use os.path.sep instead of raw \ * simplify imports and remove type annotation * make ruff happy * apply review suggestions * replace run with with_id kwarg to run * update imports to avoid deprecation warnings for the latest client --------- Co-authored-by: kshitij12345 <kshitijkalambarkar@gmail.com>
This commit is contained in:
parent
d4d628462f
commit
0a570dbd2e
@ -1220,8 +1220,12 @@ class NeptuneCallback(TrainerCallback):
|
||||
self._run = None
|
||||
|
||||
def _initialize_run(self, **additional_neptune_kwargs):
|
||||
from neptune.new import init_run
|
||||
from neptune.new.exceptions import NeptuneMissingApiTokenException, NeptuneMissingProjectNameException
|
||||
try:
|
||||
from neptune import init_run
|
||||
from neptune.exceptions import NeptuneMissingApiTokenException, NeptuneMissingProjectNameException
|
||||
except ImportError:
|
||||
from neptune.new import init_run
|
||||
from neptune.new.exceptions import NeptuneMissingApiTokenException, NeptuneMissingProjectNameException
|
||||
|
||||
self._stop_run_if_exists()
|
||||
|
||||
@ -1245,7 +1249,7 @@ class NeptuneCallback(TrainerCallback):
|
||||
return
|
||||
|
||||
if self._run and not self._is_monitoring_run and not self._force_reset_monitoring_run:
|
||||
self._initialize_run(run=self._run_id)
|
||||
self._initialize_run(with_id=self._run_id)
|
||||
self._is_monitoring_run = True
|
||||
else:
|
||||
self._initialize_run()
|
||||
@ -1257,7 +1261,7 @@ class NeptuneCallback(TrainerCallback):
|
||||
else:
|
||||
if not self._run:
|
||||
self._initialize_run(
|
||||
run=self._run_id,
|
||||
with_id=self._run_id,
|
||||
capture_stdout=False,
|
||||
capture_stderr=False,
|
||||
capture_hardware_metrics=False,
|
||||
|
Loading…
Reference in New Issue
Block a user