FILL-MASK task code question #2265
-
Hi everyone! I am learning DJL and thought it will help me a lot if I started a little project. My main (noob) goal is to get the top String text = "Hello I'm a [MASK] model.";
Block block = new LambdaBlock(
a -> {
NDManager manager = a.getManager();
float[][] logits = new float[10][4828];
logits[6][4827] = 5;
logits[6][2535] = 4;
logits[6][2047] = 3;
logits[6][3565] = 2;
logits[6][2986] = 1;
NDArray arr = manager.create(logits);
arr = arr.expandDims(0);
return new NDList(arr);
},
"model");
[...] I suspect it has a close relationship with the My goal will be to be able to provide any length sentence and get some more coherent results. If you know more documentation on this would be greatly appreciated! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
@LMartinezEXEX In real case, you need load a huggingface model from the folder, or using existing DJL's huggingface model zoo:
|
Beta Was this translation helpful? Give feedback.
@LMartinezEXEX
This is a mock test, we created a Block that mock the real model's output.
In real case, you need load a huggingface model from the folder, or using existing DJL's huggingface model zoo: