mirror of
https://git.datalinker.icu/vllm-project/vllm.git
synced 2025-12-15 04:35:01 +08:00
[Deprecation] Require overriding get_dummy_text and get_dummy_mm_data (#18796)
Signed-off-by: DarkLight1337 <tlleungac@connect.ust.hk>
This commit is contained in:
parent
b78f844a67
commit
7f2c1a87e9
@ -1,6 +1,5 @@
|
|||||||
# SPDX-License-Identifier: Apache-2.0
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
|
from abc import ABC, abstractmethod
|
||||||
from abc import ABC
|
|
||||||
from collections.abc import Mapping
|
from collections.abc import Mapping
|
||||||
from dataclasses import dataclass, field
|
from dataclasses import dataclass, field
|
||||||
from typing import Generic, NamedTuple, Optional, TypeVar, Union, cast
|
from typing import Generic, NamedTuple, Optional, TypeVar, Union, cast
|
||||||
@ -60,29 +59,14 @@ class BaseDummyInputsBuilder(ABC, Generic[_I]):
|
|||||||
|
|
||||||
self.info = info
|
self.info = info
|
||||||
|
|
||||||
# TODO: @abstractmethod after transition
|
@abstractmethod
|
||||||
def get_dummy_text(self, mm_counts: Mapping[str, int]) -> str:
|
def get_dummy_text(self, mm_counts: Mapping[str, int]) -> str:
|
||||||
"""
|
"""
|
||||||
Build the text input corresponding to `mm_counts`.
|
Build the text input corresponding to `mm_counts`.
|
||||||
"""
|
"""
|
||||||
if (type(self).get_dummy_processor_inputs ==
|
|
||||||
BaseDummyInputsBuilder.get_dummy_processor_inputs):
|
|
||||||
raise NotImplementedError
|
raise NotImplementedError
|
||||||
|
|
||||||
logger.warning_once("`get_dummy_processor_inputs` has been split up "
|
@abstractmethod
|
||||||
"into `get_dummy_text` and `get_dummy_mm_data`. "
|
|
||||||
"These two methods will be marked as abstract "
|
|
||||||
"in an upcoming release.")
|
|
||||||
|
|
||||||
seq_len = self.info.ctx.model_config.max_model_len
|
|
||||||
|
|
||||||
prompt = self.get_dummy_processor_inputs(seq_len, mm_counts).prompt
|
|
||||||
if not isinstance(prompt, str):
|
|
||||||
prompt = self.info.get_tokenizer().decode(prompt)
|
|
||||||
|
|
||||||
return prompt
|
|
||||||
|
|
||||||
# TODO: @abstractmethod after transition
|
|
||||||
def get_dummy_mm_data(
|
def get_dummy_mm_data(
|
||||||
self,
|
self,
|
||||||
seq_len: int,
|
seq_len: int,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user