add __repr__ to the BitsAndBytesConfig class (#25517)

add __repr__
This commit is contained in:
YQ 2023-08-15 17:11:28 +08:00 committed by GitHub
parent 7a94ea4c64
commit f11518a542
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -272,6 +272,10 @@ class BitsAndBytesConfig(QuantizationConfigMixin):
return output
def __repr__(self):
config_dict = self.to_dict()
return f"{self.__class__.__name__} {json.dumps(config_dict, indent=2, sort_keys=True)}\n"
def to_diff_dict(self) -> Dict[str, Any]:
"""
Removes all attributes from config which correspond to the default config attributes for better readability and