Class FillMaskTranslator.Builder

  • Enclosing class:
    FillMaskTranslator

    public static final class FillMaskTranslator.Builder
    extends java.lang.Object
    The builder for fill mask translator.
    • Method Detail

      • optMaskToken

        public FillMaskTranslator.Builder optMaskToken​(java.lang.String maskedToken)
        Sets the id of the mask Translator.
        Parameters:
        maskedToken - the id of the mask
        Returns:
        this builder
      • optTopK

        public FillMaskTranslator.Builder optTopK​(int topK)
        Set the topK number of classes to be displayed.
        Parameters:
        topK - the number of top classes to return
        Returns:
        this builder
      • optBatchifier

        public FillMaskTranslator.Builder optBatchifier​(ai.djl.translate.Batchifier batchifier)
        Sets the Batchifier for the Translator.
        Parameters:
        batchifier - true to include token types
        Returns:
        this builder
      • configure

        public void configure​(java.util.Map<java.lang.String,​?> arguments)
        Configures the builder with the model arguments.
        Parameters:
        arguments - the model arguments
      • build

        public FillMaskTranslator build()
                                 throws java.io.IOException
        Builds the translator.
        Returns:
        the new translator
        Throws:
        java.io.IOException - if I/O error occurs