Team members with a Models Viewer seat cannot download artifacts.
Download and use an artifact stored on W&B
Download an artifact as a tracked run input when it is a run dependency, or fetch it directly for workflows that don’t require lineage tracking.References that have schemes that W&B knows how to handle get downloaded just like artifact files. For more information, see Track external files.
- Use
Artifact.download()to download all files. - Use
Artifact.get_entry()to retrieve a specific entry, and then call.download()to download it.
- Track run input
- Fetch directly
- W&B CLI
Use
wandb.Run.use_artifact() to download an artifact as part of a W&B run. W&B records the artifact as an input to the run.- Import the W&B Python SDK and initialize a W&B Run.
- Retrieve the artifact version with
wandb.Run.use_artifact(). - Download all files or a specific file from the returned
Artifactobject.
Partially download an artifact
You can optionally download part of an artifact based on a prefix. Use thepath_prefix= (wandb.Artifact.download(path_prefix=)) parameter to download a single file or the content of a sub-folder.
path_prefix= parameter. Continuing from the previous code snippet:
Use an artifact from a different project
Specify the name of artifact along with its project name to reference an artifact. You can also reference artifacts across entities by specifying the name of the artifact with its entity name. The following code example demonstrates how to query an artifact from another project as input to the current W&B run.Construct and use an artifact simultaneously
Simultaneously construct and use an artifact. Create an artifact object and pass it to use_artifact. This creates an artifact in W&B if it does not exist yet. Thewandb.Run.use_artifact() API is idempotent, so you can call it as many times as you like.