Skip to content

Commit d9141d9

Browse files
committed
update
1 parent 6bf7171 commit d9141d9

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/compressed_tensors/compressors/model_compressors/model_compressor.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -182,12 +182,15 @@ def from_pretrained_model(
182182
algorithm
183183
:return: compressor for the configs, or None if model is not compressed
184184
"""
185-
# assume multiple compression formats means mixed-precision
186-
# as we currently only support one compressor per precision type and scheme
185+
187186
if quantization_format is not None:
188-
if isinstance(quantization_format, str):
187+
# llmcompressor incorrectly passes in a CompressionFormat when
188+
# the value string is expected - handle both cases
189+
if isinstance(quantization_format, (str, CompressionFormat)):
189190
quantization_format = [quantization_format]
190191

192+
# assume multiple compression formats means mixed-precision
193+
# as we currently only support one compressor per precision type and scheme
191194
if len(quantization_format) > 1:
192195
quantization_format = CompressionFormat.mixed_precision.value
193196
else:

0 commit comments

Comments
 (0)