vllm.transformers_utils.repo_utils ¶
Utilities for model repo interaction.
_try_download_from_hf_hub ¶
Try to download a file from HuggingFace Hub.
Returns the local path on success, None on failure. Skips download if model is a local directory.
Source code in vllm/transformers_utils/repo_utils.py
get_hf_file_bytes ¶
get_hf_file_bytes(
file_name: str,
model: str | Path,
revision: str | None = "main",
) -> bytes | None
Get file contents from HuggingFace repository as bytes.
Source code in vllm/transformers_utils/repo_utils.py
get_hf_file_to_dict ¶
Downloads a file from the Hugging Face Hub and returns its contents as a dictionary.
Parameters: - file_name (str): The name of the file to download. - model (str): The name of the model on the Hugging Face Hub. - revision (str): The specific version of the model.
Returns: - config_dict (dict): A dictionary containing the contents of the downloaded file.