From 5a58d3938f09b5ee48cfb03cef552b48a1563638 Mon Sep 17 00:00:00 2001 From: Max de Bayser Date: Thu, 24 Oct 2024 11:11:04 -0300 Subject: [PATCH] linting Signed-off-by: Max de Bayser --- vllm/engine/llm_engine.py | 3 ++- vllm/model_executor/model_loader/loader.py | 28 +++++++++++----------- vllm/transformers_utils/config.py | 6 ++--- 3 files changed, 19 insertions(+), 18 deletions(-) diff --git a/vllm/engine/llm_engine.py b/vllm/engine/llm_engine.py index e98d5b6525a2d..2637a59470592 100644 --- a/vllm/engine/llm_engine.py +++ b/vllm/engine/llm_engine.py @@ -293,7 +293,8 @@ def __init__( model_config.pooling_config.pooling_type, model_config.pooling_config.normalize, model_config.chat_template_text_format, - model_config.mm_processor_kwargs,) + model_config.mm_processor_kwargs, + ) # TODO(woosuk): Print more configs in debug mode. self.model_config = model_config self.cache_config = cache_config diff --git a/vllm/model_executor/model_loader/loader.py b/vllm/model_executor/model_loader/loader.py index 12a9fa0aee6ee..133654e53c5d4 100644 --- a/vllm/model_executor/model_loader/loader.py +++ b/vllm/model_executor/model_loader/loader.py @@ -148,17 +148,18 @@ def _get_model_initialization_kwargs( return extra_kwargs -def build_model(model_class: Type[nn.Module], hf_config: PretrainedConfig, +def build_model(model_class: Type[nn.Module], + hf_config: PretrainedConfig, cache_config: Optional[CacheConfig], - quant_config: Optional[QuantizationConfig], *, + quant_config: Optional[QuantizationConfig], + *, lora_config: Optional[LoRAConfig], multimodal_config: Optional[MultiModalConfig], scheduler_config: Optional[SchedulerConfig], pooling_config: Optional[PoolingConfig] = None) -> nn.Module: extra_kwargs = _get_model_initialization_kwargs(model_class, lora_config, multimodal_config, - scheduler_config - ) + scheduler_config) return model_class(config=hf_config, cache_config=cache_config, @@ -176,16 +177,15 @@ def _initialize_model( """Initialize a model with the given configurations.""" model_class, _ = get_model_architecture(model_config) - return build_model( - model_class, - model_config.hf_config, - cache_config=cache_config, - quant_config=_get_quantization_config(model_config, load_config), - lora_config=lora_config, - multimodal_config=model_config.multimodal_config, - scheduler_config=scheduler_config, - pooling_config=model_config.pooling_config - ) + return build_model(model_class, + model_config.hf_config, + cache_config=cache_config, + quant_config=_get_quantization_config( + model_config, load_config), + lora_config=lora_config, + multimodal_config=model_config.multimodal_config, + scheduler_config=scheduler_config, + pooling_config=model_config.pooling_config) class BaseModelLoader(ABC): diff --git a/vllm/transformers_utils/config.py b/vllm/transformers_utils/config.py index 2ba3863f33e3d..b109d46f0b7fb 100644 --- a/vllm/transformers_utils/config.py +++ b/vllm/transformers_utils/config.py @@ -6,9 +6,9 @@ import huggingface_hub from huggingface_hub import (file_exists, hf_hub_download, try_to_load_from_cache) -from huggingface_hub.utils import (RepositoryNotFoundError, - RevisionNotFoundError, EntryNotFoundError, - LocalEntryNotFoundError) +from huggingface_hub.utils import (EntryNotFoundError, LocalEntryNotFoundError, + RepositoryNotFoundError, + RevisionNotFoundError) from transformers import GenerationConfig, PretrainedConfig from transformers.models.auto.image_processing_auto import ( get_image_processor_config)