IMPORTANT: To view this page as Markdown, append `.md` to the URL (e.g. /max/get-started.md). For the complete documentation index, see llms.txt.
Skip to main content
For the complete documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /max/get-started.md).

Python class

IdentityPipelineTokenizer

IdentityPipelineTokenizer​

class max.pipelines.IdentityPipelineTokenizer(*args, **kwargs)

source

Bases: PipelineTokenizer[TokenGeneratorContext, str, TextGenerationRequest]

A pass-through tokenizer that returns prompts unchanged.

decode()​

async decode(encoded, **kwargs)

source

Returns the encoded string unchanged (identity decoding).

Parameters:

encoded (str)

Return type:

str

encode()​

async encode(prompt, add_special_tokens=False)

source

Returns the prompt unchanged (identity encoding).

Parameters:

  • prompt (str)
  • add_special_tokens (bool)

Return type:

str

eos​

property eos: int

source

Returns the end-of-sequence token ID (0 for identity).

expects_content_wrapping​

property expects_content_wrapping: bool

source

Returns whether this tokenizer expects content wrapping.