Skip to content

Commit

Permalink
small fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Cyrilvallez committed Feb 5, 2025
1 parent e831055 commit bbab9b2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/transformers/modeling_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -4803,7 +4803,7 @@ def _load_pretrained_model(
map_location = torch.device([d for d in device_map.values() if d not in ["cpu", "disk"]][0])

# For nice tqdm bars
if len(checkpoint_files) > 1:
if checkpoint_files is not None and len(checkpoint_files) > 1:
checkpoint_files = logging.tqdm(checkpoint_files, desc="Loading checkpoint shards")

# To be able to iterate, even if we don't use it
Expand Down Expand Up @@ -4972,7 +4972,7 @@ def _load_from_tf(cls, model, config, checkpoint_files):
return model

@classmethod
def _load_from_flax(model, checkpoint_files):
def _load_from_flax(cls, model, checkpoint_files):
try:
from .modeling_flax_pytorch_utils import load_flax_checkpoint_in_pytorch_model

Expand Down

0 comments on commit bbab9b2

Please sign in to comment.