| 73 | |
| 74 | @dataclass |
| 75 | class LongLiveQuantizationConfig(QuantizationConfig): |
| 76 | type: str = "weight" |
| 77 | |
| 78 | def __post_init__(self) -> None: |
| 79 | super().__post_init__() |
| 80 | |
| 81 | if not isinstance(self.type, str): |
| 82 | raise TypeError("Quantization type must be a string.") |
| 83 | if self.type not in QUANTIZATION_TYPE: |
| 84 | allowed = ", ".join(QUANTIZATION_TYPE.keys()) |
| 85 | raise ValueError(f"Unknown quantization type '{self.type}'. Expected one of: {allowed}.") |
| 86 | |
| 87 | self.type = QUANTIZATION_TYPE[self.type] |
| 88 | |
| 89 | |
| 90 | def _resolve_modules_to_not_convert( |