Package ai.djl.huggingface.translator
Class CrossEncoderTranslator.Builder
java.lang.Object
ai.djl.huggingface.translator.CrossEncoderTranslator.Builder
- Enclosing class:
- CrossEncoderTranslator
The builder for question answering 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.optSigmoid(boolean sigmoid) Sets if apply sigmoid for theTranslator.
-
Method Details
-
optIncludeTokenTypes
Sets if include token types for theTranslator.- Parameters:
includeTokenTypes- true to include token types- Returns:
- this builder
-
optSigmoid
Sets if apply sigmoid for theTranslator.- Parameters:
sigmoid- true to apply sigmoid- 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
-