def load(model_spec, specification_version, file_weights_dir="", **kwargs):
    """
    Load in-memory Proto specification of Model(.Proto) object to PyMIL

    Set force_spec_version to force override the spec version.
    """
    if not isinstance(model_spec, proto.Model_pb2.Model):
        raise TypeError("Invalid Model sepc object")

    if specification_version < model_spec.specificationVersion:
        if not kwargs.get("force_spec_version", False):
            raise ValueError(
                "specification_version must be greater or equal to the input model spec version"
            )

    if model_spec.WhichOneof("Type") != "mlProgram":
        raise ValueError("Only MIL proto based mlmodels can be loaded")

    return load_mil_proto(model_spec.mlProgram, specification_version, file_weights_dir)

    Load in-memory Proto specification of Model(.Proto) object to PyMIL

    Set force_spec_version to force override the spec version.
    
coremltools/converters/mil/frontend/milproto/load.py