File size: 374 Bytes
4189f9e
 
 
 
 
8c25be7
4189f9e
d39ca84
4189f9e
8c25be7
1
2
3
4
5
6
7
8
9
10
import { pipeline, env } from 'https://cdn.jsdelivr.net/npm/@xenova/transformers@2.10.1';

// 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))