*** layout: overview slug: nemo-curator/nemo\_curator/models/prompt\_formatter title: nemo\_curator.models.prompt\_formatter --------------------------------------------- ## Module Contents ### Classes | Name | Description | | -------------------------------------------------------------------------- | ----------- | | [`PromptFormatter`](#nemo_curator-models-prompt_formatter-PromptFormatter) | - | ### Data [`VARIANT_MAPPING`](#nemo_curator-models-prompt_formatter-VARIANT_MAPPING) ### API ```python class nemo_curator.models.prompt_formatter.PromptFormatter( prompt_variant: str ) ``` ```python nemo_curator.models.prompt_formatter.PromptFormatter.create_message( prompt: str ) -> list[dict[str, typing.Any]] ``` Create a message. **Parameters:** The text input to create a message for. **Returns:** `list[dict[str, Any]]` List of messages for the VLM model including the text prompt and video. ```python nemo_curator.models.prompt_formatter.PromptFormatter.generate_inputs( prompt: str, video_inputs: torch.Tensor | None = None, override_text_prompt: bool = False ) -> dict[str, typing.Any] ``` Generate inputs for video and text data based on prompt\_variant. Processes video and text inputs to create the input for the model. It handles both video and image inputs, decoding video and applying preprocessing if needed, and creates a structured input dictionary containing the processed prompt and multimodal data. **Parameters:** Text prompt to be included with the input. Frames per second of the input video. Data type to use for preprocessing the video/image inputs. Number of frames to extract from the video. If 0, uses all frames. Whether to flip the input video/image horizontally. Pre-processed video inputs. If None, and video data is to be passed to the model, then video cannot be None. whether the text prompt should be overridden **Returns:** `dict[str, Any]` dict containing: * "prompt": The processed text prompt with chat template applied * "multi\_modal\_data": Dictionary containing processed "image" and/or "video" inputs ```python nemo_curator.models.prompt_formatter.VARIANT_MAPPING = {'qwen': 'Qwen/Qwen2.5-VL-7B-Instruct'} ```