MCPcopy Create free account
hub / github.com/apple/coremltools / from_memory

Method from_memory

coremltools/models/model.py:285–306  ·  view source on GitHub ↗

Create an MLModelAsset instance from in-memory data. Parameters ---------- spec_data : bytes The specification data of the model. blob_mapping : Dict[str, bytes]) A dictionary with blob path as the key and blob data as the value.

(
        cls,
        spec_data: bytes,
        blob_mapping: _Dict[str, bytes] = {},
    )

Source from the content-addressed store, hash-verified

283
284 @classmethod
285 def from_memory(
286 cls,
287 spec_data: bytes,
288 blob_mapping: _Dict[str, bytes] = {},
289 ) -> "MLModelAsset":
290 """
291 Create an MLModelAsset instance from in-memory data.
292
293 Parameters
294 ----------
295 spec_data : bytes
296 The specification data of the model.
297
298 blob_mapping : Dict[str, bytes])
299 A dictionary with blob path as the key and blob data as the value.
300
301 Returns
302 -------
303 MLModelAsset
304 An instance of MLModelAsset created from the provided memory data.
305 """
306 return _MLModelProxy.create_model_asset_from_memory(spec_data, blob_mapping)
307
308class MLModel:
309 """

Callers 2

test_inmemory_modelMethod · 0.45

Calls

no outgoing calls

Tested by 2

test_inmemory_modelMethod · 0.36