Skip to content

Commit

Permalink
fix fstr format (#2810)
Browse files Browse the repository at this point in the history
* fix fstr format

* Quality pass
  • Loading branch information
Jintao-Huang authored Jun 7, 2024
1 parent 24d8b63 commit 83bad87
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/accelerate/accelerator.py
Original file line number Diff line number Diff line change
Expand Up @@ -3123,7 +3123,9 @@ def _inner(folder):
f for f in os.listdir(input_dir) if re.search(r"^custom_checkpoint_\d+\.pkl$", f) is not None
]
if len(custom_checkpoints) != len(self._custom_objects):
err = "Number of custom checkpoints in folder {input_dir} does not match the number of registered objects:"
err = (
f"Number of custom checkpoints in folder {input_dir} does not match the number of registered objects:"
)
err += f"\n\tFound checkpoints: {len(custom_checkpoints)}"
err += f"\n\tRegistered objects: {len(self._custom_objects)}\n"
err += "Please make sure to only load checkpoints from folders that were created with the same set of registered objects,"
Expand Down
2 changes: 1 addition & 1 deletion src/accelerate/state.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ def __init__(self, cpu: bool = False, **kwargs):
original_backend = kwargs.pop("backend", None)
backend, distributed_type = self._prepare_backend(cpu, use_sagemaker_dp, original_backend)
if original_backend is not None and backend != original_backend:
raise ValueError("Your assigned backend {original_backend} is not avaliable, please use {backend}")
raise ValueError(f"Your assigned backend {original_backend} is not avaliable, please use {backend}")
self.backend = backend
self.distributed_type = distributed_type
use_deepspeed = False
Expand Down

0 comments on commit 83bad87

Please sign in to comment.