We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b20fbf3 commit f8ff22bCopy full SHA for f8ff22b
bitsandbytes/functional.py
@@ -531,7 +531,10 @@ def as_dict(self, packed=False):
531
# packed format allows serialization of non-tensor components, critical for saving in safetensors format
532
qs_packed_dict = {k: v for k, v in qs_dict.items() if isinstance(v, torch.Tensor)}
533
non_tensor_dict = {k: v for k, v in qs_dict.items() if not isinstance(v, torch.Tensor)}
534
- qs_packed_dict["quant_state." + "bitsandbytes__" + self.quant_type] = pack_dict_to_tensor(non_tensor_dict)
+ key = "quant_state.bitsandbytes__"
535
+ if self.quant_type is not None:
536
+ key += self.quant_type
537
+ qs_packed_dict[key] = pack_dict_to_tensor(non_tensor_dict)
538
return qs_packed_dict
539
540
def to(self, device):
0 commit comments