[Misc] Update to comply with the new compressed-tensors config (#5350)
Co-authored-by: Michael Goin <michael@neuralmagic.com>
This commit is contained in:
co-authored by
Michael Goin
parent
45f92c00cf
commit
5884c2b454
@@ -122,12 +122,9 @@ def get_quant_config(model_config: ModelConfig,
|
||||
hf_quant_config = getattr(model_config.hf_config, "quantization_config",
|
||||
None)
|
||||
if hf_quant_config is None:
|
||||
compression_config = getattr(model_config.hf_config,
|
||||
"compression_config", None)
|
||||
if compression_config is not None:
|
||||
hf_quant_config = compression_config.get("quantization_config",
|
||||
None)
|
||||
|
||||
# compressed-tensors uses a compressions_config
|
||||
hf_quant_config = getattr(model_config.hf_config, "compression_config",
|
||||
None)
|
||||
if hf_quant_config is not None:
|
||||
return quant_cls.from_config(hf_quant_config)
|
||||
# In case of bitsandbytes/QLoRA, get quant config from the adapter model.
|
||||
|
||||
Reference in New Issue
Block a user