def model_has_adapters(model_path: Union[str, Path]) -> bool:
    """Check if the model has adapters.

    :param model_path: The path to the model.
    :return: True if the model has adapters, False otherwise.
    """
    dag = OnnxDAG(onnx.load(model_path, load_external_data=False))
    for node_name in dag.get_node_names():
        op_type = dag.get_node_op_type(node_name)
        if op_type in {"MatMul", "MatMulNBits"} and any(re.match(pattern, node_name) for pattern in LORA_NAME_PATTERNS):
            return True
    return False
Check if the model has adapters.

    :param model_path: The path to the model.
    :return: True if the model has adapters, False otherwise.
    
olive/passes/onnx/common.py