Skip to content

vllm_omni.model_executor.model_loader.weight_utils

logger module-attribute

logger = init_logger(__name__)

download_weights_from_hf_specific

download_weights_from_hf_specific(
    model_name_or_path: str,
    cache_dir: str | None,
    allow_patterns: list[str],
    revision: str | None = None,
    ignore_patterns: str | list[str] | None = None,
    require_all: bool = False,
) -> str

Download model weights from Hugging Face Hub. Users can specify the allow_patterns to download only the necessary weights.

Parameters:

Name Type Description Default
model_name_or_path str

The model name or path.

required
cache_dir Optional[str]

The cache directory to store the model weights. If None, will use HF defaults.

required
allow_patterns list[str]

The allowed patterns for the weight files. Files matched by any of the patterns will be downloaded.

required
revision Optional[str]

The revision of the model.

None
ignore_patterns Optional[Union[str, list[str]]]

The patterns to filter out the weight files. Files matched by any of the patterns will be ignored.

None
require_all bool

If True, will iterate through and download files matching all patterns in allow_patterns. If False, will stop after the first pattern that matches any files.

False

Returns:

Name Type Description
str str

The path to the downloaded model weights.