Skip to content

Commit

Permalink
Create inference.js
Browse files Browse the repository at this point in the history
  • Loading branch information
KOSASIH authored Nov 20, 2024
1 parent e90dcd3 commit b312895
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions dapps-builder/src/components/AIEngine/inference.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export const makePrediction = async (model, input) => {
const inputTensor = tf.tensor2d([input]);
const prediction = model.predict(inputTensor);
return prediction.arraySync();
};

0 comments on commit b312895

Please sign in to comment.