1313
1414from vllm .beam_search import (BeamSearchInstance , BeamSearchOutput ,
1515 BeamSearchSequence , get_beam_search_score )
16- from vllm .config import CompilationConfig
16+ from vllm .config import CompilationConfig , ModelDType , TokenizerMode
1717from vllm .engine .arg_utils import (EngineArgs , HfOverrides , PoolerConfig ,
1818 TaskOption )
1919from vllm .engine .llm_engine import LLMEngine
3232from vllm .lora .request import LoRARequest
3333from vllm .model_executor .guided_decoding .guided_fields import (
3434 GuidedDecodingRequest , LLMGuidedOptions )
35+ from vllm .model_executor .layers .quantization import QuantizationMethods
3536from vllm .outputs import (ClassificationRequestOutput , EmbeddingRequestOutput ,
3637 PoolingRequestOutput , RequestOutput ,
3738 ScoringRequestOutput )
@@ -163,20 +164,20 @@ def __init__(
163164 self ,
164165 model : str ,
165166 tokenizer : Optional [str ] = None ,
166- tokenizer_mode : str = "auto" ,
167+ tokenizer_mode : TokenizerMode = "auto" ,
167168 skip_tokenizer_init : bool = False ,
168169 trust_remote_code : bool = False ,
169170 allowed_local_media_path : str = "" ,
170171 tensor_parallel_size : int = 1 ,
171- dtype : str = "auto" ,
172- quantization : Optional [str ] = None ,
172+ dtype : ModelDType = "auto" ,
173+ quantization : Optional [QuantizationMethods ] = None ,
173174 revision : Optional [str ] = None ,
174175 tokenizer_revision : Optional [str ] = None ,
175176 seed : Optional [int ] = None ,
176177 gpu_memory_utilization : float = 0.9 ,
177178 swap_space : float = 4 ,
178179 cpu_offload_gb : float = 0 ,
179- enforce_eager : Optional [ bool ] = None ,
180+ enforce_eager : bool = False ,
180181 max_seq_len_to_capture : int = 8192 ,
181182 disable_custom_all_reduce : bool = False ,
182183 disable_async_output_proc : bool = False ,
@@ -189,12 +190,7 @@ def __init__(
189190 compilation_config : Optional [Union [int , dict [str , Any ]]] = None ,
190191 ** kwargs ,
191192 ) -> None :
192- '''
193- LLM constructor.
194-
195- Note: if enforce_eager is unset (enforce_eager is None)
196- it defaults to False.
197- '''
193+ """LLM constructor."""
198194
199195 if "disable_log_stats" not in kwargs :
200196 kwargs ["disable_log_stats" ] = True
0 commit comments