def get_model_config(model_name_or_path: str, **kwargs) -> "PretrainedConfig":
    """Get HF Config for the given model_name_or_path."""
    model_config = from_pretrained(AutoConfig, model_name_or_path, "config", **kwargs)

    # add quantization config
    quantization_config = kwargs.get("quantization_config")
    if not quantization_config:
        return model_config

    if hasattr(model_config, "quantization_config") and model_config.quantization_config:
        logger.warning(
            "Model config already has quantization_config but new quantization_config is provided as load kwargs."
            " Ignoring the new quantization_config. This quantization config might be different from the one used by"
            " the model."
        )
    else:
        model_config.quantization_config = quantization_config
    return model_config
Get HF Config for the given model_name_or_path.
olive/common/hf/utils.py