From d4f7ba6de84eb8edcf2b7bf1e631e4703b97b17f Mon Sep 17 00:00:00 2001 From: Sam Sneed <163201376+sam-sneed@users.noreply.github.com> Date: Fri, 31 May 2024 22:06:42 +0000 Subject: [PATCH] Update jspp.js --- jspp.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jspp.js b/jspp.js index 289867a..5f2a5e1 100644 --- a/jspp.js +++ b/jspp.js @@ -16,11 +16,11 @@ class JSPlusPlus { // labels to include. const gen = new JSPlusPlus.General gen.require("https://cdn.jsdelivr.net/npm/@tensorflow/tfjs") - gen.require("https://cdn.jsdelivr.net/npm/@tensorflow-models/toxicity") + const t = gen.require("https://cdn.jsdelivr.net/npm/@tensorflow-models/toxicity") let threshold = 0.9; let toxic = false - toxicity.load(threshold).then(model => { + t.toxicity.load(threshold).then(model => { model.classify(sentences).then(predictions => { predictions.forEach(classified => { if (classified.label == "toxicity") {