cerebras.modelzoo.data_preparation.data_preprocessing.hooks.pretraining_image_captions_hook#

cerebras.modelzoo.data_preparation.data_preprocessing.hooks.pretraining_image_captions_hook(example, **read_hook_kwargs)[source]#

Transforms image and caption data for pretraining.

Parameters
  • example (Dict[str, Any]) – The input data containing image and caption information.

  • **read_hook_kwargs (Any) – Additional keyword arguments containing data_keys.

Returns

Transformed data suitable for pretraining.

Return type

List[Dict[str, Any]]

Raises

AssertionError – If required keys are not provided in read_hook_kwargs.