Update jspp.js

This commit is contained in:
Sam Sneed 2024-05-31 23:11:37 +00:00 committed by GitHub
parent 1d9124721d
commit cc9a7d6515
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -18,11 +18,10 @@ class JSPlusPlus {
gen.require("https://cdn.jsdelivr.net/npm/@tensorflow/tfjs") gen.require("https://cdn.jsdelivr.net/npm/@tensorflow/tfjs")
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 threshold = 0.9;
var per = "" return toxicity.load(threshold).then(model => {
toxicity.load(threshold).then(model => { return model.classify(sentences).then(predictions => {
model.classify(sentences).then(predictions => {
console.log(predictions) console.log(predictions)
per = predictions return predictions
}); });
}); });
} }