Contents

load(_:configuration:completionHandler:)

Construct a model asynchronously from a compiled model asset.

Declaration

class func load(_ asset: MLModelAsset, configuration: MLModelConfiguration, completionHandler handler: @escaping  @Sendable (MLModel?, (any Error)?) -> Void)
class func load(asset: MLModelAsset, configuration: MLModelConfiguration) async throws -> MLModel

Parameters

  • asset:

    The compiled model asset derived from in-memory or on-disk Core ML model.

  • configuration:

    The model configuration that holds options for loading the model.

  • handler:

    The completion handler invoked when the load completes. A valid Mlmodel returns on success, or an error if failure.

See Also

Loading a model