MCPcopy Index your code
hub / github.com/tensorflow/tfjs-examples / init

Method init

translation/index.js:39–46  ·  view source on GitHub ↗

* Initializes the Translation demo.

(urls)

Source from the content-addressed store, hash-verified

37 * Initializes the Translation demo.
38 */
39 async init(urls) {
40 this.urls = urls;
41 const model = await loader.loadHostedPretrainedModel(urls.model);
42 await this.loadMetadata();
43 this.prepareEncoderModel(model);
44 this.prepareDecoderModel(model);
45 return this;
46 }
47
48 async loadMetadata() {
49 const translationMetadata =

Callers 6

initFunction · 0.45
setupTranslatorFunction · 0.45
onCreateMethod · 0.45
onCreateMethod · 0.45
onCreateMethod · 0.45

Calls 3

loadMetadataMethod · 0.95
prepareEncoderModelMethod · 0.95
prepareDecoderModelMethod · 0.95

Tested by

no test coverage detected