Classes
CLASS Granite33InputProcessor
Input processor for version 3.3 of the main Granite models, all sizes.
This input processor is based on the Jinja template from tokenizer_config.json.
FUNC sanitize
chat_completion: The chat completion request to sanitize.parts: Which parts of the chat completion to sanitize; defaults to"all".
- The sanitized chat completion with all Granite 3.3 special tokens
- removed from the specified parts.
FUNC transform
chat_completion: The structured chat completion request to convert into a tokenizer-ready prompt string.add_generation_prompt: WhenTrue, appends the assistant role header to the end of the prompt to trigger generation. Defaults toTrue.
- The prompt string formatted for the Granite 3.3 model tokenizer.
ValueError: If conflicting options are specified, such as enablingthinkingmode together with documents, tools, or a custom system message; or enablingcitationsorhallucinationswith a custom system message.