p5tutorial2 / index.js
sarahciston's picture
update prompt to fix mask err
d39ca84 verified
raw
history blame
374 Bytes
import { pipeline, env } from 'https://cdn.jsdelivr.net/npm/@xenova/[email protected]';
// Since we will download the model from the Hugging Face Hub, we can skip the local model check
env.allowLocalModels = false;
const unmasker = await pipeline('fill-mask');
var out = await unmasker("The man has a job as a [MASK] and ...", {top_k: 3})
out.forEach(console.log(out))