Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
transformers
Commits
f11518a5
Unverified
Commit
f11518a5
authored
Aug 15, 2023
by
YQ
Committed by
GitHub
Aug 15, 2023
Browse files
add __repr__ to the BitsAndBytesConfig class (#25517)
add __repr__
parent
7a94ea4c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
0 deletions
+4
-0
src/transformers/utils/quantization_config.py
src/transformers/utils/quantization_config.py
+4
-0
No files found.
src/transformers/utils/quantization_config.py
View file @
f11518a5
...
@@ -272,6 +272,10 @@ class BitsAndBytesConfig(QuantizationConfigMixin):
...
@@ -272,6 +272,10 @@ class BitsAndBytesConfig(QuantizationConfigMixin):
return
output
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
]:
def
to_diff_dict
(
self
)
->
Dict
[
str
,
Any
]:
"""
"""
Removes all attributes from config which correspond to the default config attributes for better readability and
Removes all attributes from config which correspond to the default config attributes for better readability and
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment