MCPcopy Create free account
hub / github.com/NVIDIA/TensorRT-LLM / download_hf_model

Function download_hf_model

tensorrt_llm/llmapi/utils.py:225–236  ·  view source on GitHub ↗
(model: str, revision: Optional[str] = None)

Source from the content-addressed store, hash-verified

223
224
225def download_hf_model(model: str, revision: Optional[str] = None) -> Path:
226 ignore_patterns = ["original/**/*"]
227 logger.info(f"Downloading model {model} from HuggingFace")
228 with get_file_lock(model):
229 hf_folder = snapshot_download(
230 model,
231 local_files_only=huggingface_hub.constants.HF_HUB_OFFLINE,
232 ignore_patterns=ignore_patterns,
233 revision=revision,
234 tqdm_class=DisabledTqdm)
235 logger.info(f"Finished downloading model {model} from HuggingFace")
236 return Path(hf_folder)
237
238
239def download_hf_pretrained_config(model: str,

Callers 3

test_download_configFunction · 0.90
_download_hf_modelMethod · 0.85

Calls 2

get_file_lockFunction · 0.85
infoMethod · 0.45

Tested by 1

test_download_configFunction · 0.72