nemo_automodel.components.models.glm5_next.processing

View as Markdown

Build the GLM-5.3 image processor on Transformers versions before 5.16.

Module Contents

Functions

NameDescription
_enable_image_placeholdersRender image content as GLM image tokens while preserving the shipped template.
_load_chat_template-
_load_processor_config-
build_glm5_next_processorCreate the image-only GLM-5.3 processor used by MedPix recipes.

Data

_IMAGE_PLACEHOLDER

_MEDIA_REMINDER

__all__

API

nemo_automodel.components.models.glm5_next.processing._enable_image_placeholders(
template: str | None
) -> str | None

Render image content as GLM image tokens while preserving the shipped template.

The initial GLM-5.3-Flash checkpoint template renders every media block as a text-only capability reminder. That leaves Glm46VProcessor.__call__ no <|image|> token to expand even though it receives and patchifies the image. MedPix fine-tuning requires the native begin/image/end token triplet; video retains the checkpoint’s reminder because this onboarding is image-only.

nemo_automodel.components.models.glm5_next.processing._load_chat_template(
path_or_id: str,
kwargs: typing.Any = {}
) -> str | None
nemo_automodel.components.models.glm5_next.processing._load_processor_config(
path_or_id: str,
kwargs: typing.Any = {}
) -> dict[str, typing.Any]
nemo_automodel.components.models.glm5_next.processing.build_glm5_next_processor(
pretrained_model_name_or_path: str,
kwargs: typing.Any = {}
) -> transformers.processing_utils.ProcessorMixin

Create the image-only GLM-5.3 processor used by MedPix recipes.

nemo_automodel.components.models.glm5_next.processing._IMAGE_PLACEHOLDER = '{%- if media_type == \'image\' -%}\n {{- "<|begin_of_image|><|im...
nemo_automodel.components.models.glm5_next.processing._MEDIA_REMINDER = '{{- "<reminder>You are unable to process this " ~ media_type ~ " because you do...
nemo_automodel.components.models.glm5_next.processing.__all__ = ['build_glm5_next_processor']