nemo_rl.data.datasets.response_datasets.mmpr_tiny#

Module Contents#

Classes#

MMPRTinyDataset

Wrapper around the MMPR-Tiny dataset (OpenGVLab/MMPR-Tiny).

Functions#

format_mmpr_tiny_dataset

Format the MMPR-Tiny dataset into an OpenAI-API-like message log.

_ensure_mmpr_cached

Download and extract MMPR-Tiny images if not already cached.

_load_mmpr_tiny_from_cache

Load MMPR-Tiny dataset from a preprocessed cache directory.

Data#

API#

nemo_rl.data.datasets.response_datasets.mmpr_tiny._IMAGE_PLACEHOLDER_RE#

‘compile(…)’

nemo_rl.data.datasets.response_datasets.mmpr_tiny.format_mmpr_tiny_dataset(
example: dict[str, Any],
) dict[str, Any]#

Format the MMPR-Tiny dataset into an OpenAI-API-like message log.

Supports multi-image rows by splitting question text on and <image_N> placeholders and interleaving image content items with text segments. Each placeholder consumes the next image path in order.

nemo_rl.data.datasets.response_datasets.mmpr_tiny._ensure_mmpr_cached(download_dir: str) None#

Download and extract MMPR-Tiny images if not already cached.

Thread-safe: uses atomic marker file to prevent race conditions in distributed settings.

nemo_rl.data.datasets.response_datasets.mmpr_tiny._load_mmpr_tiny_from_cache(download_dir: str) datasets.Dataset#

Load MMPR-Tiny dataset from a preprocessed cache directory.

class nemo_rl.data.datasets.response_datasets.mmpr_tiny.MMPRTinyDataset(
split: str = 'train',
download_dir: str = '',
split_validation_size: float = 0,
seed: int = 42,
**kwargs,
)#

Bases: nemo_rl.data.datasets.raw_dataset.RawDataset

Wrapper around the MMPR-Tiny dataset (OpenGVLab/MMPR-Tiny).

Supports loading from a local preprocessed cache or downloading from HuggingFace.

Parameters:
  • split – Dataset split to use. Only “train” is supported (validation is created via split_validation_size).

  • download_dir – Directory containing the preprocessed MMPR-Tiny cache, or the target directory for downloading from HuggingFace.

  • split_validation_size – Fraction of data to hold out for validation (default 0).

  • seed – Random seed for train/validation split (default 42).

Initialization