Prerequisites for downloading and uploading Model artifacts in air-gapped environment

Consider the prerequisites before downloading or uploading models in air-gapped environments.

  • Make sure, you install the followings:

    • pip install -U "huggingface_hub[cli]"
    • pip install awscli==1.35.0 is required for on premises setups.
    • pip install pyyaml
    • https://org.ngc.nvidia.com/setup/installers/cli for NVIDIA NGC catalog Models.

      Make sure you configure the NVIDIA NGC client with the credentials provided by Cloudera.

    • Make sure the Python version is 3.10.12 or higher.
  • NVIDIA NGC access credentials are provided by Cloudera during onboarding.
  • Consider the following configuration details for NVIDA NGC:
    echo 'export NGC_CLI_API_KEY=<key>' >> ~/.bashrc 
    echo 'export NGC_CLI_ORG=<org>' >> ~/.bashrc

    If the system has ~/.bash_profile follow the above steps, but replace bashrc with bash_profile.

  • Download the following script to enable downloading Model repositories from the Hugging Face or NVIDIA NGC catalog and uploading Models to on premises storage providers.

    Download the script from here: https://github.com/cloudera/Model-Hub/blob/main/airgap-scripts/pvc/1.5.5/import_to_airgap.py

    The script has the following parameters:

    Table 1.
    Parameter Value Description
    -do Activates download mod
    -rt hf Repository type: "hf" for Hugging Face (use "ngc" for NVIDIA NGC catalog)
    -t hf_hVQbUsafafafafadfadfsNAynASXJoTCWHAEkj

    Hugging Face API token for authentication (required for private or gated Models)

    The Hugging Face token (-t) is required for accessing gated

    Models or Models that require authentication. For more information about tokens, see:https://huggingface.co/docs/hub/en/security-tokens

    -p $PWD/models Local destination path where Model files are downloaded (uses current working directory)
    -ri Nvidia/Llama-3.1-Nemotron-70B-Instruct-HF Repository ID for the model on Hugging Face. profileId of the optimization profile in the NGC specification for the model.
    -ns ngc_spec.yaml NGC-specific to refer to for downloading models in cage of NGC models