Downloading model repositories in an air-gapped environment
To use models from Hugging Face, NVIDIA NGC (NIM), and Mistral, the Administrator must download model artifacts from these sources on specially networked hosts, bastion hosts.
Downloading a HuggingFace model
-
Download the model from Hugging Face to your local file system by using the following example command:
python3 import_to_airgap.py -do -rt hf -t [***HF TOKEN***] -ri hf-tiny-model-private/tiny-random-YosoModelThe download includes all model files and metadata in the destination directory.
Table 1. Argument Description -do Specifies the download-only operation. -rt hf Indicates that the repository type is Hugging Face (hf). -ri hf-tiny-model-private/tiny-random-YosoModel Specifies the repository ID (model name) to download.
You can obtain theriargument for Hugging Face by performing the following actions:- Go to the Hugging Face website at https://huggingface.co/.
-
Search for the required model.
The page of the model displays.
- Click the
icon next to the name of
the model, and copy the model ID. Use this ID as
the riargument.
-t Specifies your Hugging Face token. The Hugging Face token needs to provide readaccess to the repositories. For more information on Hugging Face tokens, see User access tokens.Result:
The script downloads the Model metadata and the Model files. By default, it saves them in themodelsdirectory in your current working directory. To save them in a different directory, use the-pparameter.Fetching information for hf repository: hf-tiny-model-private/tiny-random-YosoModel Download path: ./models finish downloading metadata file Saved metadata to ./models/hf/hf-tiny-model-private/tiny-random-YosoModel/metadata/metadata.json Downloading repository: hf-tiny-model-private/tiny-random-YosoModel to ./models Starting download with huggingface-cli... Download completed successfully for hf-tiny-model-private/tiny-random-YosoModelThe script saves the files in the following directories:./models/hf/hf-tiny-model-private/tiny-random-YosoModel/artifacts: model files./models/hf/hf-tiny-model-private/tiny-random-YosoModel/metadata:metadata.json
If you use the
configureoption the default path is $HOME/.airgap/model.
Downloading an NVIDIA NGC (NIM) model
- Download the NVIDIA NGC (NIM) model to your local file system using the
following command:
python3 import_to_airgap.py -do -rt ngc -ri nim/meta/llama-3_1-70b-instruct:0.11.1+14957bf8-h100x4-fp8-throughput.1.2.18099809 -ns ngc_spec.yamlFor NVIDIA NGC (NIM) catalog downloads, use the
-rt ngcargument and provide an NVIDIA NGC specification file with the-nsparameter. The-nsparameter is required only when you download NVIDIA NGC models. The specification file is provided by Cloudera. For more information, contact Cloudera Support.The download includes all model files and metadata in the specified destination directory.
Downloading a Mistral model
For more information on how to download a Mistral Model, see Downloading Mistral Model.
