nemo_gym.vision_input

View as Markdown

Shared prompt and image input construction for HLE datasets.

Module Contents

Functions

NameDescription
_to_data_uriNormalize an HLE image field into a data URI usable as an image_url.
build_image_inputBuild a materialized responses_create_params.input for one row.

API

nemo_gym.vision_input._to_data_uri(
image: str
) -> str

Normalize an HLE image field into a data URI usable as an image_url.

The cais/hle image column stores a base64 data URI string (e.g. data:image/png;base64,...) for image questions. If a raw base64 payload is encountered instead, wrap it with a PNG data-URI prefix.

nemo_gym.vision_input.build_image_input(
question: str,
image: str
) -> list[dict]

Build a materialized responses_create_params.input for one row.

Applies the shared prompt template, then (for image questions) rewrites the user turn into a multimodal content list with an input_image block.