MCPcopy
hub / github.com/tensorflow/tfjs / getModelArtifactsForJSON

Function getModelArtifactsForJSON

tfjs-core/src/io/io_utils.ts:582–595  ·  view source on GitHub ↗
(
    modelJSON: ModelJSON,
    loadWeights: (weightsManifest: WeightsManifestConfig) => Promise<[
      /* weightSpecs */ WeightsManifestEntry[], WeightData,
    ]>)

Source from the content-addressed store, hash-verified

580 * @returns A Promise of the `ModelArtifacts`, as described by the JSON file.
581 */
582export async function getModelArtifactsForJSON(
583 modelJSON: ModelJSON,
584 loadWeights: (weightsManifest: WeightsManifestConfig) => Promise<[
585 /* weightSpecs */ WeightsManifestEntry[], WeightData,
586 ]>): Promise<ModelArtifacts> {
587 let weightSpecs: WeightsManifestEntry[] | undefined;
588 let weightData: WeightData | undefined;
589
590 if (modelJSON.weightsManifest != null) {
591 [weightSpecs, weightData] = await loadWeights(modelJSON.weightsManifest);
592 }
593
594 return getModelArtifactsForJSONSync(modelJSON, weightSpecs, weightData);
595}
596
597/**
598 * Populate ModelArtifactsInfo fields for a model with JSON topology.

Callers 2

loadMethod · 0.90
loadMethod · 0.90

Calls 2

loadWeightsFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…