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 9f7a329 commit c81c8abCopy full SHA for c81c8ab
quantize.py
@@ -552,17 +552,16 @@ def __init__(
552
*,
553
bitwidth: int = 8,
554
groupsize: Optional[int] = None,
555
- packed=False,
+ packed=True,
556
):
557
+ # when quantization dictionary comes from JSON, packed is a string
558
if isinstance(packed, str):
- packed = packed == "True"
559
+ packed = packed.lower() != "false"
560
self.model_ = model
561
self.device = device
562
self.groupsize = groupsize
563
self.bitwidth = bitwidth
564
self.packed = packed
- if (bitwidth != 4) and packed:
565
- raise RuntimeError("pack only works with bitsize 4")
566
567
@torch.no_grad()
568
def create_quantized_state_dict(self, packed=False) -> Dict:
0 commit comments