Class NoBadWordsLogitsProcessor

java.lang.Object
chat.octet.model.components.processor.impl.NoBadWordsLogitsProcessor
All Implemented Interfaces:
LogitsProcessor

public class NoBadWordsLogitsProcessor extends Object implements LogitsProcessor
  • Constructor Details

    • NoBadWordsLogitsProcessor

      public NoBadWordsLogitsProcessor(int[] badWordsTokenIds)
  • Method Details

    • processor

      public float[] processor(@Nullable int[] inputTokenIds, @Nonnull float[] scores, Object... args)
      Description copied from interface: LogitsProcessor
      Logits processor
      Specified by:
      processor in interface LogitsProcessor
      Parameters:
      inputTokenIds - Indices of input sequence tokens in the vocabulary.
      scores - Prediction scores of a language modeling head. These can be logits for each vocabulary.
      args - Specific args to a logits processor.
      Returns:
      float[] The processed prediction scores.