Contents

modelDescription(completionHandler:)

The default model descripton.

Declaration

func modelDescription(completionHandler handler: @escaping  @Sendable (MLModelDescription?, (any Error)?) -> Void)
var modelDescription: MLModelDescription { get async throws }

Discussion

Use this method to get the description of the model such as the feature descriptions, the model author, and other metadata.

For the multi-function model asset, this method vends the description for the default function. Use modelDescription(for:) to get the model description of other functions.

let modelAsset = try MLModelAsset(url: modelURL)
let modelDescription = try await modelAsset.modelDescription()
print(modelDescription)

See Also

Getting the model description