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

Method load

tfjs-core/src/io/http.ts:188–195  ·  view source on GitHub ↗

* Load model artifacts via HTTP request(s). * * See the documentation to `tf.io.http` for details on the saved * artifacts. * * @returns The loaded model artifacts (if loading succeeds).

()

Source from the content-addressed store, hash-verified

186 * @returns The loaded model artifacts (if loading succeeds).
187 */
188 async load(): Promise<ModelArtifacts> {
189 if (this.loadOptions.streamWeights) {
190 return this.loadStream();
191 }
192 const modelJSON = await this.loadModelJSON();
193 return getModelArtifactsForJSON(
194 modelJSON, (weightsManifest) => this.loadWeights(weightsManifest));
195 }
196
197 private async loadStream(): Promise<ModelArtifacts> {
198 const modelJSON = await this.loadModelJSON();

Callers 15

runFunction · 0.45
generateCloudbuildFunction · 0.45
createVideoElementFunction · 0.45
indexed_db_test.tsFile · 0.45
cloneModelInternalFunction · 0.45
http_test.tsFile · 0.45

Calls 4

loadStreamMethod · 0.95
loadModelJSONMethod · 0.95
loadWeightsMethod · 0.95
getModelArtifactsForJSONFunction · 0.90

Tested by

no test coverage detected