mirror of
https://github.com/huggingface/text-generation-inference.git
synced 2025-06-07 09:52:18 +00:00
fix Qwen VL break in intel platform
Signed-off-by: Wang, Yi A <yi.a.wang@intel.com>
This commit is contained in:
parent
4b8cda684b
commit
57385c5463
@ -577,6 +577,12 @@ class RotaryPositionEmbeddingMultimodalSections(PositionRotaryEmbedding):
|
|||||||
cos: torch.Tensor,
|
cos: torch.Tensor,
|
||||||
sin: torch.Tensor,
|
sin: torch.Tensor,
|
||||||
):
|
):
|
||||||
|
|
||||||
|
if SYSTEM == "ipex":
|
||||||
|
ipex.llm.functional.rotary_embedding(
|
||||||
|
query, key, sin, cos, query.size(-1), True
|
||||||
|
)
|
||||||
|
else:
|
||||||
# rotate half the sequence length
|
# rotate half the sequence length
|
||||||
rot = cos.shape[-1] // 2
|
rot = cos.shape[-1] // 2
|
||||||
q2 = torch.cat([-query[..., rot:], query[..., :rot]], dim=-1)
|
q2 = torch.cat([-query[..., rot:], query[..., :rot]], dim=-1)
|
||||||
|
Loading…
Reference in New Issue
Block a user