module-attribute  ¶
 LogitsProcessor: TypeAlias = (
    Callable[[list[int], Tensor], Tensor]
    | Callable[[list[int], list[int], Tensor], Tensor]
)
LogitsProcessor is a function that takes a list of previously generated tokens, the logits tensor for the next token and, optionally, prompt tokens as a first argument, and returns a modified tensor of logits to sample from.
 
 Source code in vllm/logits_process.py
  
  Source code in vllm/logits_process.py
  
    
 _check_token_ids_bounds(vocab_size: int) -> None
Source code in vllm/logits_process.py
  
  Source code in vllm/logits_process.py
  
 get_bad_words_logits_processors(
    bad_words: list[str], tokenizer: AnyTokenizer
) -> list[LogitsProcessor]