Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
chenpangpang
transformers
Commits
26ddc580
Unverified
Commit
26ddc580
authored
Apr 25, 2024
by
Younes Belkada
Committed by
GitHub
Apr 25, 2024
Browse files
Quantization: `HfQuantizer` quant method update (#30484)
ensure popular quant methods are supported
parent
f3962712
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
0 deletions
+3
-0
src/transformers/modeling_utils.py
src/transformers/modeling_utils.py
+3
-0
No files found.
src/transformers/modeling_utils.py
View file @
26ddc580
...
...
@@ -3170,6 +3170,9 @@ class PreTrainedModel(nn.Module, ModuleUtilsMixin, GenerationMixin, PushToHubMix
torch_dtype
=
hf_quantizer
.
update_torch_dtype
(
torch_dtype
)
device_map
=
hf_quantizer
.
update_device_map
(
device_map
)
# In order to ensure popular quantization methods are supported. Can be disable with `disable_telemetry`
user_agent
[
"quant"
]
=
hf_quantizer
.
quantization_config
.
quant_method
.
value
# Force-set to `True` for more mem efficiency
if
low_cpu_mem_usage
is
None
:
low_cpu_mem_usage
=
True
...
...
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