Interface LogitsProcessor

All Known Implementing Classes:
CustomBiasLogitsProcessor, LogitsProcessorList, NoBadWordsLogitsProcessor

public interface LogitsProcessor
Customize a processor to adjust the probability distribution of words and control the generation of model inference results.

Note: Referenced the Transformers document implementation.

Author:
William
  • Method Summary

    Modifier and Type
    Method
    Description
    float[]
    processor(int[] inputTokenIds, float[] scores, Object... args)
    Logits processor
  • Method Details

    • processor

      float[] processor(@Nullable int[] inputTokenIds, @Nonnull float[] scores, Object... args)
      Logits processor
      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.