Compare commits

...

7 Commits

Author SHA1 Message Date
Sayak Paul
c42a42d62c Merge branch 'main' into repr-quant-config 2025-06-18 09:44:19 +05:30
Sayak Paul
386f8f4c15 Merge branch 'main' into repr-quant-config 2025-06-10 06:57:46 +05:30
Sayak Paul
22794e6459 Merge branch 'main' into repr-quant-config 2025-06-02 08:12:51 -07:00
Sayak Paul
895428be9c Merge branch 'main' into repr-quant-config 2025-05-09 09:35:22 +05:30
Sayak Paul
17cdc984ed Merge branch 'main' into repr-quant-config 2025-05-03 12:29:59 +05:30
Sayak Paul
e80567d6d2 Merge branch 'main' into repr-quant-config 2025-05-02 11:03:10 +05:30
sayakpaul
8464ddf12c add __repr__ for better printing of configs. 2025-04-29 22:39:13 +08:00

View File

@@ -428,6 +428,10 @@ class GGUFQuantizationConfig(QuantizationConfigMixin):
if self.compute_dtype is None:
self.compute_dtype = torch.float32
def __repr__(self):
config_dict = self.to_dict()
return f"{self.__class__.__name__} {json.dumps(config_dict, indent=2, sort_keys=True)}\n"
@dataclass
class TorchAoConfig(QuantizationConfigMixin):
@@ -724,3 +728,7 @@ class QuantoConfig(QuantizationConfigMixin):
accepted_weights = ["float8", "int8", "int4", "int2"]
if self.weights_dtype not in accepted_weights:
raise ValueError(f"Only support weights in {accepted_weights} but found {self.weights_dtype}")
def __repr__(self):
config_dict = self.to_dict()
return f"{self.__class__.__name__} {json.dumps(config_dict, indent=2, sort_keys=True)}\n"