MCPcopy Create free account
hub / github.com/tensorflow/tfjs / load

Method load

tfjs-react-native/src/bundle_resource_io.ts:53–62  ·  view source on GitHub ↗

* Load a model from local storage. * * See the documentation to `browserLocalStorage` for details on the saved * artifacts. * * @returns The loaded model (if loading succeeds).

()

Source from the content-addressed store, hash-verified

51 * @returns The loaded model (if loading succeeds).
52 */
53 async load(): Promise<io.ModelArtifacts> {
54 const weightsAssets = this.modelWeightsId.map(id => Asset.fromModule(id));
55 if (weightsAssets[0].uri.match('^http')) {
56 // In debug/dev mode RN will serve these assets over HTTP
57 return this.loadViaHttp(weightsAssets);
58 } else {
59 // In release mode the assets will be on the file system.
60 return this.loadLocalAsset(weightsAssets);
61 }
62 }
63
64 async loadViaHttp(weightsAssets: Asset[]): Promise<io.ModelArtifacts> {
65 const modelJson = this.modelJson;

Callers

nothing calls this directly

Calls 2

loadViaHttpMethod · 0.95
loadLocalAssetMethod · 0.95

Tested by

no test coverage detected