Hello All,
When running a tfjs-node script (using node.js) that uses the Universal Sentence Encoder Model – I noticed that Node downloads a 525 Megabyte file each time it runs.
Is there a way to download the Universal Sentence Encoder Model Once and then load it from the file system within my node.js script?
I have tried numerous Partially related suggestions related to other models that involve using python scripts to convert models but the USE model doesn’t seem to have a Save or Load Method that works with the local file system.
Thank you for any recommendations.
I am using the basic USE example (below) for testing and platform is windows 10
const tf = require('@tensorflow/tfjs-node');
const use = require('@tensorflow-models/universal-sentence-encoder');
// cannot load TF-Lite Model from here.
//const model = tf.loadGraphModel('file:///Users/bigal/Documents/tf_js_model_save_load2/models/model.json');
use.load().then(model => {
const sentences = [
'Hello.',
'How are you?'
];
model.embed(sentences).then(embeddings => {
embeddings.print(true /* verbose */);
});
});
-AL