From 24acc782d30c974f94e36da932c7bb49ed212143 Mon Sep 17 00:00:00 2001 From: Sam Sneed <163201376+sam-sneed@users.noreply.github.com> Date: Fri, 31 May 2024 22:43:43 +0000 Subject: [PATCH] Update jspp.js --- jspp.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/jspp.js b/jspp.js index 201d3a2..9b42bb7 100644 --- a/jspp.js +++ b/jspp.js @@ -18,18 +18,17 @@ 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; - let toxic = false toxicity.load(threshold).then(model => { model.classify(sentences).then(predictions => { predictions.forEach(classified => { if (classified.label == "toxicity") { - toxic = classified.results.match + var toxic = classified.results.match } }); }); }); - return toxic + return toxic } async asyncSleep(ms) {