diff --git a/src/transformers/modeling_utils.py b/src/transformers/modeling_utils.py index ece787c7b675..49f7b03d4ece 100644 --- a/src/transformers/modeling_utils.py +++ b/src/transformers/modeling_utils.py @@ -3567,7 +3567,7 @@ def save_pretrained( for name, tensor in state_dict.items(): # Sometimes in the state_dict we have non-tensor objects. # e.g. in bitsandbytes we have some `str` objects in the state_dict - if isinstance(tensor, torch.Tensor) or isinstance(tensor, DTensor): + if isinstance(tensor, torch.Tensor): ptrs[id_tensor_storage(tensor)].append(name) else: # In the non-tensor case, fall back to the pointer of the object itself