xformjs / deberta.js
boazchung's picture
Update deberta.js
43fcfb0 verified
raw
history blame
388 Bytes
// Import the library
import { pipeline } from 'https://cdn.jsdelivr.net/npm/@xenova/[email protected]';
// Make it available globally
window.pipeline = pipeline;
async function makepipe() {
return await pipeline('sentiment-analysis');
}
async function main() {
let pipe = await makepipe();
let out = await pipe('I love transformers!');
console.log(out);
}
main();