def get_auto_gptq_qlinear_cls(quantization_config):
    """Get the right AutoGPTQQuantLinear class based on the quantization config."""
    if transformers.utils.import_utils.is_auto_gptq_available():
        from auto_gptq.utils.import_utils import dynamically_import_QuantLinear

        desc_act = quantization_config.desc_act
        group_size = quantization_config.group_size
        bits = quantization_config.bits
        if hasattr(quantization_config, "use_exllama"):
            use_exllama = quantization_config.use_exllama
        else:
            use_exllama = not quantization_config.disable_exllama
        if hasattr(quantization_config, "exllama_config"):
            exllama_version = quantization_config.exllama_config["version"]
        else:
            exllama_version = 1
        return dynamically_import_QuantLinear(
            use_triton=False,
            desc_act=desc_act,
            group_size=group_size,
            bits=bits,
            disable_exllama=not (use_exllama and exllama_version == 1),
            disable_exllamav2=not (use_exllama and exllama_version == 2),
        )
    return None
Get the right AutoGPTQQuantLinear class based on the quantization config.
olive/common/hf/quant.py