Load
default_ngc_client(use_guest_if_api_key_invalid=True)
Create a default NGC client.
This should load the NGC API key from ~/.ngc/config, or from environment variables passed to the docker container.
Source code in bionemo/core/data/load.py
78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 |
|
default_pbss_client()
Create a default S3 client for PBSS.
Source code in bionemo/core/data/load.py
51 52 53 54 55 56 |
|
load(model_or_data_tag, source=DEFAULT_SOURCE, resources=None, cache_dir=None)
Download a resource from PBSS or NGC.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
model_or_data_tag
|
str
|
A pointer to the desired resource. Must be a key in the resources dictionary. |
required |
source
|
SourceOptions
|
Either "pbss" (NVIDIA-internal download) or "ngc" (NVIDIA GPU Cloud). Defaults to "pbss". |
DEFAULT_SOURCE
|
resources
|
dict[str, Resource] | None
|
A custom dictionary of resources. If None, the default resources will be used. (Mostly for testing.) |
None
|
cache_dir
|
Path | None
|
The directory to store downloaded files. Defaults to BIONEMO_CACHE_DIR. (Mostly for testing.) |
None
|
Raises:
Type | Description |
---|---|
ValueError
|
If the desired tag was not found, or if an NGC url was requested but not provided. |
Returns:
Type | Description |
---|---|
Path
|
A Path object pointing either at the downloaded file, or at a decompressed folder containing the |
Path
|
file(s). |
Examples:
For a resource specified in 'filename.yaml' with tag 'tag', the following will download the file:
>>> load("filename/tag")
PosixPath(/tmp/bionemo/downloaded-file-name)
Source code in bionemo/core/data/load.py
139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 |
|