IMPORTANT: To view this page as Markdown, append `.md` to the URL (e.g. /max/get-started.md). For the complete documentation index, see llms.txt.
Skip to main content
For the complete documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /max/get-started.md).

Python function

download_weight_files

download_weight_files()​

max.pipelines.weights.download_weight_files(huggingface_model_id, filenames, revision=None, force_download=False, max_workers=8)

source

Downloads weight files for a Hugging Face model and returns local paths.

Parameters:

  • huggingface_model_id (str) – The Hugging Face model identifier, that is, modularai/Llama-3.1-8B-Instruct-GGUF
  • filenames (list[str]) – A list of file paths relative to the root of the Hugging Face repo. If files provided are available locally, download is skipped, and the local files are used.
  • revision (str | None) – The Hugging Face revision to use. If provided, we check our cache directly without needing to go to Hugging Face directly, saving a network call.
  • force_download (bool) – A boolean, indicating whether we should force the files to be redownloaded, even if they are already available in our local cache, or a provided path.
  • max_workers (int) – The number of worker threads to concurrently download files.

Return type:

list[Path]