From 4aa90e68db61d04b982eeb4a9ec8c3aac4349245 Mon Sep 17 00:00:00 2001 From: Sam Sneed <163201376+sam-sneed@users.noreply.github.com> Date: Fri, 31 May 2024 23:14:40 +0000 Subject: [PATCH] Update jspp.js --- jspp.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/jspp.js b/jspp.js index b12995b..76040a4 100644 --- a/jspp.js +++ b/jspp.js @@ -18,12 +18,15 @@ class JSPlusPlus { gen.require("https://cdn.jsdelivr.net/npm/@tensorflow/tfjs") gen.require("https://cdn.jsdelivr.net/npm/@tensorflow-models/toxicity") let threshold = 0.9; - return toxicity.load(threshold).then(model => { - return model.classify(sentences).then(predictions => { - console.log(predictions) - return predictions + let t = await toxicity.load(threshold).then(model => { + let m = await model.classify(sentences).then(predictions => { + let p = await predictions + console.log(p) + return p }); + return m }); + return t } async asyncSleep(ms) {