<!--
{
  "availability" : [
    "iOS: 18.0.0 -",
    "iPadOS: 18.0.0 -",
    "macCatalyst: 18.0.0 -",
    "macOS: 15.0.0 -",
    "tvOS: 18.0.0 -",
    "visionOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreML",
  "identifier" : "/documentation/CoreML/MLModelAsset/init(specification:blobMapping:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "Core ML"
    ],
    "preciseIdentifier" : "c:objc(cs)MLModelAsset(cm)modelAssetWithSpecificationData:blobMapping:error:"
  },
  "title" : "init(specification:blobMapping:)"
}
-->

# init(specification:blobMapping:)

Construct a model asset from an ML Program specification by replacing blob file references with corresponding in-memory blobs.

```
convenience init(specification specificationData: Data, blobMapping: [URL : Data]) throws
```

## Parameters

`blobMapping`

A dictionary with blob URL as the key and blob data as the value.

## Discussion

An ML Program may use `BlobFileValue` syntax, which stores the blob data in external files and refers them by URL.
This factory method enables in-memory workflow for such models by using the specified in-memory blob data in place of the external files.

The format of in-memory blobs must be the same as the external files. The dictionary must contain all the reference URLs used in the specification.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)