File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
src/compressed_tensors/quantization/lifecycle Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -117,6 +117,7 @@ def apply_quantization_config(
117117 :param run_compressed: Whether the model will be run in compressed mode or
118118 decompressed fully on load
119119 """
120+ # Workaround for when HF Quantizer passes None, see PR #180
120121 if config is None :
121122 return OrderedDict ()
122123
@@ -189,14 +190,14 @@ def apply_quantization_config(
189190 return names_to_scheme
190191
191192
192- def process_quantization_config (config : QuantizationConfig ) -> QuantizationConfig :
193+ def process_quantization_config (config : Optional [ QuantizationConfig ] ) -> Optional [ QuantizationConfig ] :
193194 """
194195 Preprocess the raw QuantizationConfig
195196
196- :param config: the raw QuantizationConfig
197- :return: the processed QuantizationConfig
197+ :param config: Optional raw QuantizationConfig
198+ :return: the processed QuantizationConfig, if the raw config is not None
198199 """
199- if config .kv_cache_scheme is not None :
200+ if config is not None and config .kv_cache_scheme is not None :
200201 config = process_kv_cache_config (config )
201202
202203 return config
You can’t perform that action at this time.
0 commit comments