diff --git a/src/transformers/training_args.py b/src/transformers/training_args.py index 3c6a5407d167a4..e51cf41106ee80 100644 --- a/src/transformers/training_args.py +++ b/src/transformers/training_args.py @@ -2208,6 +2208,9 @@ def to_dict(self): d[k] = [x.value for x in v] if k.endswith("_token"): d[k] = f"<{k.upper()}>" + # Handle the accelerator_config if passed + if is_accelerate_available() and isinstance(v, AcceleratorConfig): + d[k] = v.to_dict() return d def to_json_string(self):