Skip to content

Commit bf0f2cd

Browse files
committed
fix convert
1 parent b4e6c4d commit bf0f2cd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/transformers/core_model_loading.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ def reverse_op(self) -> ConversionOps:
159159
def convert(self, value: torch.Tensor, concrete_target_keys=None, *args, **kwargs) -> list[torch.Tensor]:
160160
# chunk requires a single tensor input (maybe not when saving actually!)
161161
udpate_ = []
162-
if len(value) != 1 or len(value[0]) != 1: # when saving we have multiple tensors
162+
if concrete_target_keys is not None: # when saving we have multiple tensors
163163
for layer in value:
164164
for tensors in layer:
165165
chunk_size = len(concrete_target_keys)

0 commit comments

Comments
 (0)