Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions tensorrt_llm/inputs/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,10 +254,12 @@ class MultimodalPlaceholderPlacement(enum.Enum):
"mllama": MultimodalPlaceholderPlacement.BEFORE_TEXT,
"hyperclovax_vlm": MultimodalPlaceholderPlacement.AFTER_TEXT,
"gemma3": MultimodalPlaceholderPlacement.BEFORE_TEXT,
# NOTE: for mistral3 multimodal models, it does not strictly have to be after the text.
# NOTE: for mistral3 multimodal models, it does not strictly have to be before the text.
# Ref: https://github.com/mistralai/mistral-common/blob/039465db2bdc0486df36365c9bdb428188482a18/
# src/mistral_common/tokens/tokenizers/base.py#L326
"mistral3": MultimodalPlaceholderPlacement.AFTER_TEXT,
# However, accuracy tests show that the model generates higher quality output when the image
# precedes the text (the relative difference can be as much as ~30% for both vLLM and TRT-LLM).
"mistral3": MultimodalPlaceholderPlacement.BEFORE_TEXT,
"phi4mm": MultimodalPlaceholderPlacement.BEFORE_TEXT,
}
assert len(PLACEHOLDER_PLACEMENT_MAP) == len(ALL_SUPPORTED_MULTIMODAL_MODELS)
Expand Down
7 changes: 5 additions & 2 deletions tests/integration/defs/test_e2e.py
Original file line number Diff line number Diff line change
Expand Up @@ -2039,8 +2039,11 @@ def test_ptp_quickstart_multimodal(llm_root, llm_venv, model_name, model_path,
"mistral-small-3.1-24b-instruct": {
"image": [
["dramatic", "seascape", "ocean", "turbulent", "waves", "dark"],
["scenic", "rock", "landscape", "snow", "altitude"],
["highway", "traffic", "directions", "lanes", "Jurong"],
["scenic", "rock", "landscape", "monolith", "formation"],
[
"multi-lane", "highway", "moderate", "traffic", "flow",
"vehicles", "congestion"
],
],
},
"gemma-3-27b-it": {
Expand Down