Update jspp.js

This commit is contained in:
Sam Sneed 2024-05-31 21:43:34 +00:00 committed by GitHub
parent 6f9e05036b
commit 0a6c39513f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

10
jspp.js
View file

@ -11,11 +11,11 @@ class JSPlusPlus {
return new Promise(resolve => setTimeout(resolve, ms)); return new Promise(resolve => setTimeout(resolve, ms));
} }
isToxic(sentences) { isToxic(sentences) {
// Load the model. Users optionally pass in a threshold and an array of // Load the model. Users optionally pass in a threshold and an array of
// labels to include. // labels to include.
pp.require("https://cdn.jsdelivr.net/npm/@tensorflow/tfjs") help.require("https://cdn.jsdelivr.net/npm/@tensorflow/tfjs")
pp.require("https://cdn.jsdelivr.net/npm/@tensorflow-models/toxicity") help.require("https://cdn.jsdelivr.net/npm/@tensorflow-models/toxicity")
let threshold = 0.9; let threshold = 0.9;
let toxic = false let toxic = false
@ -750,8 +750,7 @@ class JSPlusPlus {
initGun(relays = []) { initGun(relays = []) {
let pp = new JSPlusPlus help.require("https://cdn.jsdelivr.net/npm/gun/gun.js")
pp.require("https://cdn.jsdelivr.net/npm/gun/gun.js")
return Gun(relays) return Gun(relays)
} }
} }
@ -759,4 +758,5 @@ class JSPlusPlus {
const pp = new JSPlusPlus const pp = new JSPlusPlus
const help = new JSPLusPlus.Helpers
const htmlFront = new JSPlusPlus.HTMLFrontend const htmlFront = new JSPlusPlus.HTMLFrontend