mirror of
https://github.com/huggingface/transformers.git
synced 2025-07-31 02:02:21 +06:00
Fix state_dict map location when quantized (#37086)
* Update modeling_utils.py * Update modeling_utils.py
This commit is contained in:
parent
d6064754ea
commit
a86dad56bc
@ -4897,7 +4897,7 @@ class PreTrainedModel(nn.Module, ModuleUtilsMixin, GenerationMixin, PushToHubMix
|
||||
|
||||
map_location = "cpu"
|
||||
if low_cpu_mem_usage:
|
||||
if shard_file.endswith(".safetensors") and not is_quantized:
|
||||
if shard_file.endswith(".safetensors"):
|
||||
map_location = "meta"
|
||||
elif (
|
||||
device_map is not None
|
||||
|
Loading…
Reference in New Issue
Block a user