Load a protobuf model specification from file

    Parameters
    ----------
    filename: str
        Location on disk (a valid filepath) from which the file is loaded
        as a protobuf spec.

    Returns
    -------
    model_spec: Model_pb
        Protobuf representation of the model

    Examples
    --------
    .. sourcecode:: python

        >>> spec = coremltools.utils.load_spec('HousePricer.mlmodel')

    See Also
    --------
    save_spec

def load_spec(filename):
    """
    Load a protobuf model specification from file

    Parameters
    ----------
    filename: str
        Location on disk (a valid filepath) from which the file is loaded
        as a protobuf spec.

    Returns
    -------
    model_spec: Model_pb
        Protobuf representation of the model

    Examples
    --------
    .. sourcecode:: python

        >>> spec = coremltools.utils.load_spec('HousePricer.mlmodel')

    See Also
    --------
    save_spec
    """
    from ..proto import Model_pb2
    spec = Model_pb2.Model()

    with open(filename, 'rb') as f:
        contents = f.read()
        spec.ParseFromString(contents)
        return spec