"csrc/quantization/fp8/amd/quant_utils_src.cuh" did not exist on "5f6d10c14c17122e6d711a4829ee0ca672e07f6f"
Unverified Commit 7f2c1a87 authored by Cyrus Leung's avatar Cyrus Leung Committed by GitHub
Browse files

[Deprecation] Require overriding `get_dummy_text` and `get_dummy_mm_data` (#18796)


Signed-off-by: default avatarDarkLight1337 <tlleungac@connect.ust.hk>
parent b78f844a
# SPDX-License-Identifier: Apache-2.0
from abc import ABC
from abc import ABC, abstractmethod
from collections.abc import Mapping
from dataclasses import dataclass, field
from typing import Generic, NamedTuple, Optional, TypeVar, Union, cast
......@@ -60,29 +59,14 @@ class BaseDummyInputsBuilder(ABC, Generic[_I]):
self.info = info
# TODO: @abstractmethod after transition
@abstractmethod
def get_dummy_text(self, mm_counts: Mapping[str, int]) -> str:
"""
Build the text input corresponding to `mm_counts`.
"""
if (type(self).get_dummy_processor_inputs ==
BaseDummyInputsBuilder.get_dummy_processor_inputs):
raise NotImplementedError
logger.warning_once("`get_dummy_processor_inputs` has been split up "
"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
raise NotImplementedError
# TODO: @abstractmethod after transition
@abstractmethod
def get_dummy_mm_data(
self,
seq_len: int,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment