cerebras.modelzoo.data_preparation.data_preprocessing.hooks.finetuning_llava_hook_prompt_completion#

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

Transforms conversation data for finetuning LLaVA into SDA format.

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

  • **read_hook_kwargs (Any) – Additional keyword arguments including: - data_keys (Dict[str, str]): Dictionary specifying keys for multi-turn and image data. - image_token (str): The token used for images. - multi_turn_content_key (str, optional): Key to extract conversation content. - phase (int): The current phase of processing (1 or 2).

Returns

Transformed data in the SDA format.

Return type

List[Dict[str, Any]]

Raises

ValueError – If required data is missing or in an incorrect format.