From b87daef3187d5d6bf579dee63d117d5f0a0d923e Mon Sep 17 00:00:00 2001 From: Sam Sneed <163201376+sam-sneed@users.noreply.github.com> Date: Fri, 31 May 2024 22:13:31 +0000 Subject: [PATCH] Update jspp.js --- jspp.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/jspp.js b/jspp.js index 5f2a5e1..587954f 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") - const t = gen.require("https://cdn.jsdelivr.net/npm/@tensorflow-models/toxicity") + gen.require("https://cdn.jsdelivr.net/npm/@tensorflow-models/toxicity") let threshold = 0.9; let toxic = false - t.toxicity.load(threshold).then(model => { + toxicity.load(threshold).then(model => { model.classify(sentences).then(predictions => { predictions.forEach(classified => { if (classified.label == "toxicity") { @@ -335,9 +335,9 @@ class JSPlusPlus { require(jsURI) { try { - let req = JSPlusPlus.JSPlusPlus.readInternetText(jsURI); - let gen = new JSPlusPlus.General - gen.exec(req); + let jspp = new JSPlusPlus + jspp.readInternetText(jsURI); + jspp.exec(req); } catch { console.log(`Error! (Using Node.JS/Bun?)