mirror of
https://github.com/huggingface/transformers.git
synced 2025-08-03 03:31:05 +06:00
Fix: Ensure wandb logs config in offline mode (#38992)
* Fix: Ensure wandb logs config in offline mode * Apply style fixes --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Mohamed Mekkouri <93391238+MekkCyber@users.noreply.github.com>
This commit is contained in:
parent
fe838d6631
commit
f46798193e
@ -34,6 +34,10 @@ from typing import TYPE_CHECKING, Any, Literal, Optional, Union
|
||||
import numpy as np
|
||||
import packaging.version
|
||||
|
||||
|
||||
if os.getenv("WANDB_MODE") == "offline":
|
||||
print("⚙️ Running in WANDB offline mode")
|
||||
|
||||
from .. import PreTrainedModel, TFPreTrainedModel, TrainingArguments
|
||||
from .. import __version__ as version
|
||||
from ..utils import (
|
||||
@ -860,7 +864,7 @@ class WandbCallback(TrainerCallback):
|
||||
**init_args,
|
||||
)
|
||||
# add config parameters (run may have been created manually)
|
||||
self._wandb.config.update(combined_dict, allow_val_change=True)
|
||||
self._wandb.config.update(combined_dict or {}, allow_val_change=True)
|
||||
|
||||
# define default x-axis (for latest wandb versions)
|
||||
if getattr(self._wandb, "define_metric", None):
|
||||
|
Loading…
Reference in New Issue
Block a user