For the complete documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /get-started.md).
Python class
LabelScoringTokenizer
LabelScoringTokenizer
class max.pipelines.modeling.types.LabelScoringTokenizer(*args, **kwargs)
Bases: Protocol
Tokenizer capabilities that label scoring (/v1/decisions) needs.
Declared as a protocol, checked once when a scoring request is admitted, so a tokenizer that lacks a member is refused instead of having its context-length check skipped.
apply_chat_template()
apply_chat_template(messages, tools, **chat_template_options)
Renders messages with the model’s chat template.
-
Parameters:
-
- messages (list[TextGenerationRequestMessage])
- tools (list[TextGenerationRequestTool] | None)
- chat_template_options (Any)
-
Return type:
encode()
async encode(prompt, add_special_tokens=True)
Encodes text to token ids.
max_length
The context length, in tokens; None when unbounded.