Update jspp.js

This commit is contained in:
Sam Sneed 2024-05-31 23:27:46 +00:00 committed by GitHub
parent b4fc52365e
commit 81aabdfb07
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -19,12 +19,9 @@ class JSPlusPlus {
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;
let t = await toxicity.load(threshold).then(model => { let t = await toxicity.load(threshold).then(model => {
let m =model.classify(sentences).then(predictions => { return model.classify(sentences).then(predictions => {
let p = await predictions return predictions
console.log(p)
return p
}); });
return m
}); });
return t return t
} }