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

Method loadStream

tfjs-core/src/io/http.ts:197–208  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

195 }
196
197 private async loadStream(): Promise<ModelArtifacts> {
198 const modelJSON = await this.loadModelJSON();
199 const fetchURLs = await this.getWeightUrls(modelJSON.weightsManifest);
200 const weightSpecs = getWeightSpecs(modelJSON.weightsManifest);
201 const stream = () => streamWeights(fetchURLs, this.loadOptions);
202
203 return {
204 ...modelJSON,
205 weightSpecs,
206 getWeightStream: stream,
207 };
208 }
209
210 private async getWeightUrls(weightsManifest: WeightsManifestConfig):
211 Promise<string[]> {

Callers 1

loadMethod · 0.95

Calls 3

loadModelJSONMethod · 0.95
getWeightUrlsMethod · 0.95
getWeightSpecsFunction · 0.90

Tested by

no test coverage detected