File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
src/compressed_tensors/compressors/model_compressors Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -182,12 +182,15 @@ def from_pretrained_model(
182
182
algorithm
183
183
:return: compressor for the configs, or None if model is not compressed
184
184
"""
185
- # assume multiple compression formats means mixed-precision
186
- # as we currently only support one compressor per precision type and scheme
185
+
187
186
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 )):
189
190
quantization_format = [quantization_format ]
190
191
192
+ # assume multiple compression formats means mixed-precision
193
+ # as we currently only support one compressor per precision type and scheme
191
194
if len (quantization_format ) > 1 :
192
195
quantization_format = CompressionFormat .mixed_precision .value
193
196
else :
You can’t perform that action at this time.
0 commit comments