Skip to content

Commit

Permalink
linting
Browse files Browse the repository at this point in the history
Signed-off-by: Max de Bayser <[email protected]>
  • Loading branch information
maxdebayser committed Oct 24, 2024
1 parent da4d173 commit 5a58d39
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 18 deletions.
3 changes: 2 additions & 1 deletion vllm/engine/llm_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
28 changes: 14 additions & 14 deletions vllm/model_executor/model_loader/loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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):
Expand Down
6 changes: 3 additions & 3 deletions vllm/transformers_utils/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 5a58d39

Please sign in to comment.