|
1 | 1 | # SPDX-License-Identifier: Apache-2.0
|
2 |
| - |
3 |
| -from abc import ABC |
| 2 | +from abc import ABC, abstractmethod |
4 | 3 | from collections.abc import Mapping
|
5 | 4 | from dataclasses import dataclass, field
|
6 | 5 | from typing import Generic, NamedTuple, Optional, TypeVar, Union, cast
|
@@ -60,29 +59,14 @@ def __init__(self, info: _I) -> None:
|
60 | 59 |
|
61 | 60 | self.info = info
|
62 | 61 |
|
63 |
| - # TODO: @abstractmethod after transition |
| 62 | + @abstractmethod |
64 | 63 | def get_dummy_text(self, mm_counts: Mapping[str, int]) -> str:
|
65 | 64 | """
|
66 | 65 | Build the text input corresponding to `mm_counts`.
|
67 | 66 | """
|
68 |
| - if (type(self).get_dummy_processor_inputs == |
69 |
| - BaseDummyInputsBuilder.get_dummy_processor_inputs): |
70 |
| - raise NotImplementedError |
71 |
| - |
72 |
| - logger.warning_once("`get_dummy_processor_inputs` has been split up " |
73 |
| - "into `get_dummy_text` and `get_dummy_mm_data`. " |
74 |
| - "These two methods will be marked as abstract " |
75 |
| - "in an upcoming release.") |
76 |
| - |
77 |
| - seq_len = self.info.ctx.model_config.max_model_len |
78 |
| - |
79 |
| - prompt = self.get_dummy_processor_inputs(seq_len, mm_counts).prompt |
80 |
| - if not isinstance(prompt, str): |
81 |
| - prompt = self.info.get_tokenizer().decode(prompt) |
82 |
| - |
83 |
| - return prompt |
| 67 | + raise NotImplementedError |
84 | 68 |
|
85 |
| - # TODO: @abstractmethod after transition |
| 69 | + @abstractmethod |
86 | 70 | def get_dummy_mm_data(
|
87 | 71 | self,
|
88 | 72 | seq_len: int,
|
|
0 commit comments