opensi·si

Use {attr}model.modalities <sentencetransformers.sentencetransformer.model.SentenceTransformer.modalities> and {meth}model.supports()…

Multimodal Training

Supported Input Types

Use {attr}model.modalities <sentence_transformers.sentence_transformer.model.SentenceTransformer.modalities> and {meth}model.supports() <sentence_transformers.sentence_transformer.model.SentenceTransformer.supports> to check modality support. See Input Formats for accepted representations, metadata, and examples of combining modalities.

Training

Training a multimodal model follows the same steps as training a text-only model. You can use any compatible loss function, and the trainer and data collator handle multimodal inputs without any special configuration. Datasets can mix modalities across columns, for example a "query" column containing text strings and a "document" column containing PIL images.

Training Example: Document Screenshot Embedding

The training_visual_document_retrieval.py script finetunes Qwen/Qwen3-VL-Embedding-2B on query-document screenshot pairs for visual document retrieval. Here is how it works:

References

Source and license

Source: Sentence Transformers documentation, adapted for this site. Licensing and attribution follow the terms of the upstream project.