cerebras.modelzoo.data_preparation.data_preprocessing.hooks.chat_read_hook#

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

Transforms chat data for reading.

Parameters
  • example (Dict[str, Any]) – The input data containing chat messages.

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

Returns

Transformed data into semantic data array format.

Return type

List[Dict[str, Any]]

Raises

AssertionError – If required keys are not provided in read_hook_kwargs.