Skip to content

Commit

Permalink
Fix docs
Browse files Browse the repository at this point in the history
Signed-off-by: DarkLight1337 <[email protected]>
  • Loading branch information
DarkLight1337 committed Nov 22, 2024
1 parent c8eb070 commit 6ab14df
Showing 1 changed file with 7 additions and 12 deletions.
19 changes: 7 additions & 12 deletions vllm/multimodal/processing.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,15 +91,6 @@ def bind_segment(
_S = TypeVar("_S", str, list[int])
_S_co = TypeVar("_S_co", bound=PromptSegment, covariant=True)

ReplacementCount = Union[Callable[[_T, BatchFeature, int], int], int]
"""
Given the original data item, HF-processed data, and index of the processed
item, output the number of repetitions.
For convenience, you can pass in an integer if the number of repetitions is
a constant.
"""


@dataclass
class PromptReplacement(Generic[_S_co, _T]):
Expand All @@ -113,10 +104,14 @@ class PromptReplacement(Generic[_S_co, _T]):
See :code:`repl_count` for more details.
"""

repl_count: ReplacementCount[_T]
repl_count: Union[Callable[[_T, BatchFeature, int], int], int]
"""
The number of repetitions of :code:`repl_unit` to build up the
Given the original data item, HF-processed data, and index of the processed
item, output the number of repetitions of :code:`repl_unit` to build up the
replacement prompt segment.
For convenience, you can pass in an integer if the number of repetitions is
a constant.
"""

def __repr__(self) -> str:
Expand Down Expand Up @@ -205,7 +200,7 @@ class _BoundPromptReplacement(Generic[_T]):
modality: str
target: _BoundPromptSegment
repl_unit: _BoundPromptSegment
repl_count: ReplacementCount[_T]
repl_count: Union[Callable[[_T, BatchFeature, int], int], int]

def get_count(
self,
Expand Down

0 comments on commit 6ab14df

Please sign in to comment.