mirror of
https://git.datalinker.icu/vllm-project/vllm.git
synced 2025-12-11 00:44:57 +08:00
[Bugfix] Support compile for Transformers multimodal (#23095)
Signed-off-by: raushan <raushan@huggingface.co>
This commit is contained in:
parent
569aefd134
commit
0e3bb543f0
@ -709,6 +709,13 @@ def flatten_and_concat(x: list[torch.Tensor]) -> torch.Tensor:
|
|||||||
MultiModalProcessor,
|
MultiModalProcessor,
|
||||||
info=MultiModalProcessingInfo,
|
info=MultiModalProcessingInfo,
|
||||||
dummy_inputs=MultiModalDummyInputsBuilder)
|
dummy_inputs=MultiModalDummyInputsBuilder)
|
||||||
|
@support_torch_compile(
|
||||||
|
dynamic_arg_dims={
|
||||||
|
"input_ids": 0,
|
||||||
|
"positions": -1,
|
||||||
|
"intermediate_tensors": 0,
|
||||||
|
"inputs_embeds": 0,
|
||||||
|
}) # set `positions` to last dim to support Qwen-mrope
|
||||||
class TransformersForMultimodalLM(TransformersForCausalLM, SupportsMultiModal):
|
class TransformersForMultimodalLM(TransformersForCausalLM, SupportsMultiModal):
|
||||||
# Backwards compatibility for prev released models. State dicts back then
|
# Backwards compatibility for prev released models. State dicts back then
|
||||||
# had different formats and cannot be loaded with `AutoModel` mapping as is
|
# had different formats and cannot be loaded with `AutoModel` mapping as is
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user