@@ -78,9 +78,6 @@ class Resource(pydantic.BaseModel):
7878 Should be in format [org/[team/]]name[:version]. If None, the resource is not available on NGC.
7979 """
8080
81- ngc_registry : Literal ["model" , "resource" ] | None = None
82- """The NGC resource type (model or resource) for the data. Must be provided if ngc is not None."""
83-
8481 pbss : Annotated [pydantic .AnyUrl , pydantic .UrlConstraints (allowed_schemes = ["s3" ])]
8582 """The PBSS (NVIDIA-internal) URL of the resource."""
8683
@@ -99,12 +96,6 @@ class Resource(pydantic.BaseModel):
9996 decompress : Literal [False , None ] = None
10097 """Whether the resource should be decompressed after download. If None, will defer to the file extension."""
10198
102- @pydantic .model_validator (mode = "after" )
103- def _validate_ngc_registry (self ):
104- if self .ngc and not self .ngc_registry :
105- raise ValueError (f"ngc_registry must be provided if ngc is not None: { self .tag } " )
106- return self
107-
10899
109100@functools .cache
110101def get_all_resources (resource_path : Path | None = None ) -> dict [str , Resource ]:
@@ -216,17 +207,14 @@ class NGCDownloader:
216207 """
217208
218209 filename : str
219- ngc_registry : Literal ["model" , "resource" ]
220210
221211 def __call__ (self , url : str , output_file : str | Path , _ : pooch .Pooch ) -> None :
222212 """Download a file from NGC."""
223213 client = default_ngc_client ()
224214 nest_asyncio .apply ()
225215
226- download_fns = {
227- "model" : client .registry .model .download_version ,
228- "resource" : client .registry .resource .download_version ,
229- }
216+ # SCDL only uses NGC resources, never models
217+ download_fn = client .registry .resource .download_version
230218
231219 output_file = Path (output_file )
232220 output_file .parent .mkdir (parents = True , exist_ok = True )
@@ -235,7 +223,7 @@ def __call__(self, url: str, output_file: str | Path, _: pooch.Pooch) -> None:
235223 ngc_dirname = Path (url ).name .replace (":" , "_v" )
236224
237225 with tempfile .TemporaryDirectory (dir = output_file .parent ) as temp_dir :
238- download_fns [ self . ngc_registry ] (url , temp_dir , file_patterns = [self .filename ])
226+ download_fn (url , temp_dir , file_patterns = [self .filename ])
239227 shutil .move (Path (temp_dir ) / ngc_dirname / self .filename , output_file )
240228
241229
@@ -289,8 +277,7 @@ def load(
289277 url = resource .pbss
290278
291279 elif source == "ngc" :
292- assert resource .ngc_registry is not None
293- download_fn = NGCDownloader (filename = filename , ngc_registry = resource .ngc_registry )
280+ download_fn = NGCDownloader (filename = filename )
294281 url = resource .ngc
295282
296283 else :
0 commit comments