Contents

NLContextualEmbedding.AssetsResult

The availability of the contextual embedding model assets.

Declaration

enum AssetsResult

Overview

The framework downloads models over-the-air, so check asset availability and download them if needed.

if !embeddingModel.hasAvailableAssets {
    let downloadResult = try await embeddingModel.requestAssets()
    guard downloadResult == .available else {
       print("Assets are not available locally and failed to be downloaded. Check your network connection and try again later.")
       return
   }
}

Topics

Getting the result status

Initializers

See Also

Requesting assets