MultimodalDataset
"# MultimodalDataset\n\n```python\nfrom modal_dojo import MultimodalDataset\n```\n\nDataset of text prompts paired with image, audio, or video data.\n\n## Constructor\n\n```python\nMultimodalDataset(rows: Iterable[dict[str, Any]] | None = None, *, modality: Literal['image', 'audio', 'video'] = 'audio', media_column: str | None = None) -> None\n```\n\n## `apply_chat_template`\n\n```python\napply_chat_template() -> bool\n```\n\nWhether to apply the model's chat template to the input.\n\n## `cache_key`\n\n```python\ncache_key() -> str | None\n```\n\n## `input_key`\n\n```python\ninput_key() -> str\n```\n\nPrompt column name.\n\n## `label_key`\n\n```python\nlabel_key() -> str\n```\n\nGround-truth column name, or `None` when rows carry no label.\n\n## `output_format`\n\n```python\noutput_format() -> str\n```\n\nThe on-disk format written by `write()`, either `parquet` or `jsonl`.\n\n## `rows`\n\n```python\nrows() -> Iterable[DatasetRow]\n```\n\nLoad raw examples.\n\n**Returns**\n\nAn iterable collection of raw examples.\n\n## `source_rows`\n\n```python\nsource_rows() -> Iterable[dict[str, Any]]\n```\n\n## `validate_written`\n\n```python\nvalidate_written(path: str) -> None\n```\n\nValidate the materialized file format and required columns.\n\n## `write`\n\n```python\nwrite(path: str) -> None\n```\n\nMaterialize training data at `path`.\n"
from modal_dojo import MultimodalDatasetDataset of text prompts paired with image, audio, or video data.
Constructor
Section titled “Constructor”MultimodalDataset(rows: Iterable[dict[str, Any]] | None = None, *, modality: Literal['image', 'audio', 'video'] = 'audio', media_column: str | None = None) -> Noneapply_chat_template
Section titled “apply_chat_template”apply_chat_template() -> boolWhether to apply the model’s chat template to the input.
cache_key
Section titled “cache_key”cache_key() -> str | Noneinput_key
Section titled “input_key”input_key() -> strPrompt column name.
label_key
Section titled “label_key”label_key() -> strGround-truth column name, or None when rows carry no label.
output_format
Section titled “output_format”output_format() -> strThe on-disk format written by write(), either parquet or jsonl.
rows() -> Iterable[DatasetRow]Load raw examples.
Returns
An iterable collection of raw examples.
source_rows
Section titled “source_rows”source_rows() -> Iterable[dict[str, Any]]validate_written
Section titled “validate_written”validate_written(path: str) -> NoneValidate the materialized file format and required columns.
write(path: str) -> NoneMaterialize training data at path.