vllm.renderers.inputs.preprocess
¶
Schemas and utilities for preprocessing inputs.
Classes:
Functions:
-
parse_dec_only_prompt–Parse a prompt for a decoder-only model and normalize it to a dictionary.
-
parse_enc_dec_prompt–Parse a prompt for an encoder-decoder model and normalize it to a dictionary.
Attributes:
-
DecoderDictPrompt(TypeAlias) – -
DecoderOnlyDictPrompt(TypeAlias) – -
DictPrompt(TypeAlias) – -
EncoderDictPrompt(TypeAlias) – -
SingletonDictPrompt(TypeAlias) –
DecoderDictPrompt = TextPrompt | TokensPrompt
module-attribute
¶
A DecoderPrompt
that has been standardized into a dictionary.
DecoderOnlyDictPrompt = TextPrompt | TokensPrompt | EmbedsPrompt
module-attribute
¶
A DecoderOnlyPrompt
that has been standardized into a dictionary.
DictPrompt = DecoderOnlyDictPrompt | EncoderDecoderDictPrompt
module-attribute
¶
A PromptType
that has been standardized into a dictionary.
EncoderDictPrompt = TextPrompt | TokensPrompt
module-attribute
¶
A EncoderPrompt
that has been standardized into a dictionary.
SingletonDictPrompt = DecoderOnlyDictPrompt | EncoderDictPrompt | DecoderDictPrompt
module-attribute
¶
A SingletonPrompt
that has been standardized into a dictionary.
EncoderDecoderDictPrompt
¶
Bases: TypedDict
A EncoderDecoderPrompt
that has been standardized into a dictionary.
Source code in vllm/renderers/inputs/preprocess.py
_validate_prompt_dict(prompt)
¶
Reject malformed dict prompts before renderer tokenization.
Source code in vllm/renderers/inputs/preprocess.py
parse_dec_only_prompt(prompt)
¶
Parse a prompt for a decoder-only model and normalize it to a dictionary.
Source code in vllm/renderers/inputs/preprocess.py
parse_enc_dec_prompt(prompt)
¶
Parse a prompt for an encoder-decoder model and normalize it to a dictionary.