Skip to content

Commit

Permalink
Fix: Disable Sparse Decompression for Dense Compressors (#237)
Browse files Browse the repository at this point in the history
* Turn off sparse decompression when sparse compressor is dense

* Update: Condiition to use enum instead of raw string

* Remove unnecesarry style change
  • Loading branch information
rahul-tuli authored Jan 10, 2025
1 parent f0c369a commit 6fffbd7
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,10 @@ def decompress(self, model_path: str, model: Module):
model_path = get_safetensors_folder(model_path)
sparse_decompressed = False

if self.sparsity_compressor is not None:
if (
self.sparsity_compressor is not None
and self.sparsity_config.format != CompressionFormat.dense.value
):
# Sparse decompression is applied on the model_path
dense_gen = self.sparsity_compressor.decompress(model_path)
self._replace_weights(dense_gen, model)
Expand Down

0 comments on commit 6fffbd7

Please sign in to comment.