Skip to content

Commit

Permalink
update update_prefix_dict
Browse files Browse the repository at this point in the history
Signed-off-by: Kyle Sayers <kylesayrs@gmail.com>
  • Loading branch information
kylesayrs committed Dec 17, 2024
1 parent 1632cc3 commit 1c55a10
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/compressed_tensors/utils/offload.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,9 @@ def update_prefix_dict(module: torch.nn.Module, key: str, data: torch.Tensor):
"""
if not has_offloaded_params(module):
raise ValueError("Prefix dict is only applicable to offloaded modules")
prefix_dict = module._hf_hook.weights_map
prefix_dict.dataset[f"{prefix_dict.prefix}{key}"] = data

weights_map = module._hf_hook.weights_map
offload_to_weights_map(weights_map, key, data)


def update_parameter_data(
Expand Down

0 comments on commit 1c55a10

Please sign in to comment.