[Models] Kimi-K2.5 (#33131)
Signed-off-by: wanglinian <wanglinian@stu.pku.edu.cn> Signed-off-by: wangln19 <96399074+wangln19@users.noreply.github.com> Signed-off-by: Isotr0py <mozf@mail2.sysu.edu.cn> Signed-off-by: youkaichao <youkaichao@gmail.com> Signed-off-by: Roger Wang <hey@rogerw.io> Co-authored-by: wanglinian <wanglinian@stu.pku.edu.cn> Co-authored-by: wangln19 <96399074+wangln19@users.noreply.github.com> Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com> Co-authored-by: Isotr0py <mozf@mail2.sysu.edu.cn> Co-authored-by: Nick Hill <nickhill123@gmail.com> Co-authored-by: youkaichao <youkaichao@gmail.com> Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
This commit is contained in:
co-authored by
wanglinian
wangln19
Zaida Zhou
Isotr0py
Nick Hill
youkaichao
gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
parent
6c00645712
commit
b539f988e1
@@ -20,6 +20,7 @@ from typing import (
|
||||
)
|
||||
|
||||
import numpy as np
|
||||
from PIL.Image import Image
|
||||
from typing_extensions import NotRequired, TypeVar
|
||||
|
||||
from vllm.utils.collection_utils import full_groupby, is_list_of
|
||||
@@ -29,7 +30,6 @@ from vllm.utils.jsontree import json_map_leaves
|
||||
if TYPE_CHECKING:
|
||||
import torch
|
||||
import torch.types
|
||||
from PIL.Image import Image
|
||||
from transformers.feature_extraction_utils import BatchFeature
|
||||
|
||||
from .media import MediaWithBytes
|
||||
@@ -105,6 +105,28 @@ The number of data items allowed per modality is restricted by
|
||||
"""
|
||||
|
||||
|
||||
class VisionChunkImage(TypedDict):
|
||||
"""Represents an image wrapped as a vision chunk."""
|
||||
|
||||
type: Literal["image"]
|
||||
image: Image
|
||||
uuid: str | None
|
||||
|
||||
|
||||
class VisionChunkVideo(TypedDict):
|
||||
"""Represents a video chunk with metadata."""
|
||||
|
||||
type: Literal["video_chunk"]
|
||||
video_chunk: list[Image]
|
||||
uuid: str | None
|
||||
prompt: str
|
||||
video_idx: int
|
||||
|
||||
|
||||
VisionChunk = VisionChunkImage | VisionChunkVideo
|
||||
"""A vision chunk is either an image or a video chunk."""
|
||||
|
||||
|
||||
@final
|
||||
class MultiModalDataBuiltins(TypedDict, total=False):
|
||||
"""Type annotations for modality types predefined by vLLM."""
|
||||
@@ -118,6 +140,9 @@ class MultiModalDataBuiltins(TypedDict, total=False):
|
||||
audio: ModalityData[AudioItem]
|
||||
"""The input audio(s)."""
|
||||
|
||||
vision_chunk: ModalityData[VisionChunk]
|
||||
"""The input visual atom(s) - unified modality for images and video chunks."""
|
||||
|
||||
|
||||
MultiModalDataDict: TypeAlias = Mapping[str, ModalityData[Any]]
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user