Skip to content

Commit

Permalink
stringify config (huggingface#25637)
Browse files Browse the repository at this point in the history
* stringify config

* apply code formatting
  • Loading branch information
AleksanderWWW authored and parambharat committed Sep 26, 2023
1 parent 0f32d69 commit a4ee6db
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/transformers/integrations.py
Original file line number Diff line number Diff line change
Expand Up @@ -1283,8 +1283,12 @@ def _log_trainer_parameters(self, args):
self._metadata_namespace[NeptuneCallback.trainer_parameters_key] = args.to_sanitized_dict()

def _log_model_parameters(self, model):
from neptune.utils import stringify_unsupported

if model and hasattr(model, "config") and model.config is not None:
self._metadata_namespace[NeptuneCallback.model_parameters_key] = model.config.to_dict()
self._metadata_namespace[NeptuneCallback.model_parameters_key] = stringify_unsupported(
model.config.to_dict()
)

def _log_hyper_param_search_parameters(self, state):
if state and hasattr(state, "trial_name"):
Expand Down

0 comments on commit a4ee6db

Please sign in to comment.