Package ai.djl.huggingface.translator
Class FillMaskTranslator.Builder
java.lang.Object
ai.djl.huggingface.translator.FillMaskTranslator.Builder
- Enclosing class:
- FillMaskTranslator
The builder for fill mask translator.
-
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds the translator.voidConfigures the builder with the model arguments.optBatchifier(ai.djl.translate.Batchifier batchifier) Sets theBatchifierfor theTranslator.optIncludeTokenTypes(boolean includeTokenTypes) Sets if include token types for theTranslator.optMaskToken(String maskedToken) Sets the id of the maskTranslator.optTopK(int topK) Set the topK number of classes to be displayed.
-
Method Details
-
optMaskToken
Sets the id of the maskTranslator.- Parameters:
maskedToken- the id of the mask- Returns:
- this builder
-
optTopK
Set the topK number of classes to be displayed.- Parameters:
topK- the number of top classes to return- Returns:
- this builder
-
optIncludeTokenTypes
Sets if include token types for theTranslator.- Parameters:
includeTokenTypes- true to include token types- Returns:
- this builder
-
optBatchifier
Sets theBatchifierfor theTranslator.- Parameters:
batchifier- true to include token types- Returns:
- this builder
-
configure
Configures the builder with the model arguments.- Parameters:
arguments- the model arguments
-
build
Builds the translator.- Returns:
- the new translator
- Throws:
IOException- if I/O error occurs
-