diff --git a/dapps-builder/src/components/AIEngine/inference.js b/dapps-builder/src/components/AIEngine/inference.js new file mode 100644 index 000000000..19e52dc48 --- /dev/null +++ b/dapps-builder/src/components/AIEngine/inference.js @@ -0,0 +1,5 @@ +export const makePrediction = async (model, input) => { + const inputTensor = tf.tensor2d([input]); + const prediction = model.predict(inputTensor); + return prediction.arraySync(); +};