vllm.transformers_utils.repo_utils ¶
Utilities for model repo interaction.
Functions:
-
get_hf_file_bytes–Get file contents from HuggingFace repository as bytes.
-
get_hf_file_to_dict–Downloads a file from the Hugging Face Hub and returns
-
hf_api–Return a shared HfApi instance tagged with vLLM's library info.
-
hf_fs–Return a fresh HfFileSystem tagged with vLLM's library info.
_try_download_from_hf_hub(model, file_name, revision) ¶
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(file_name, model, revision='main') ¶
Get file contents from HuggingFace repository as bytes.
Source code in vllm/transformers_utils/repo_utils.py
get_hf_file_to_dict(file_name, model, revision='main') ¶
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.
Source code in vllm/transformers_utils/repo_utils.py
hf_api() ¶
Return a shared HfApi instance tagged with vLLM's library info.
hf_fs() ¶
Return a fresh HfFileSystem tagged with vLLM's library info.