45
45
from vllm .transformers_utils .tokenizer import (AnyTokenizer , MistralTokenizer ,
46
46
get_cached_tokenizer )
47
47
from vllm .usage .usage_lib import UsageContext
48
- from vllm .utils import (Counter , Device , deprecate_args , deprecate_kwargs ,
49
- is_list_of )
48
+ from vllm .utils import Counter , Device , deprecate_kwargs , is_list_of
50
49
51
50
if TYPE_CHECKING :
52
51
from vllm .v1 .metrics .reader import Metric
@@ -143,12 +142,6 @@ class LLM:
143
142
DEPRECATE_LEGACY : ClassVar [bool ] = True
144
143
"""A flag to toggle whether to deprecate the legacy generate/encode API."""
145
144
146
- DEPRECATE_INIT_POSARGS : ClassVar [bool ] = True
147
- """
148
- A flag to toggle whether to deprecate positional arguments in
149
- [LLM.__init__][].
150
- """
151
-
152
145
@classmethod
153
146
@contextmanager
154
147
def deprecate_legacy_api (cls ):
@@ -158,16 +151,11 @@ def deprecate_legacy_api(cls):
158
151
159
152
cls .DEPRECATE_LEGACY = False
160
153
161
- @deprecate_args (
162
- start_index = 2 , # Ignore self and model
163
- is_deprecated = lambda : LLM .DEPRECATE_INIT_POSARGS ,
164
- additional_message = (
165
- "All positional arguments other than `model` will be "
166
- "replaced with keyword arguments in an upcoming version." ),
167
- )
168
154
def __init__ (
169
155
self ,
170
156
model : str ,
157
+ * ,
158
+ task : TaskOption = "auto" ,
171
159
tokenizer : Optional [str ] = None ,
172
160
tokenizer_mode : TokenizerMode = "auto" ,
173
161
skip_tokenizer_init : bool = False ,
@@ -189,8 +177,6 @@ def __init__(
189
177
hf_token : Optional [Union [bool , str ]] = None ,
190
178
hf_overrides : Optional [HfOverrides ] = None ,
191
179
mm_processor_kwargs : Optional [dict [str , Any ]] = None ,
192
- # After positional args are removed, move this right below `model`
193
- task : TaskOption = "auto" ,
194
180
override_pooler_config : Optional [PoolerConfig ] = None ,
195
181
compilation_config : Optional [Union [int , dict [str , Any ]]] = None ,
196
182
** kwargs ,
0 commit comments