def get_artifact(
    artifact_name: str,
    project: str = settings.SETTINGS["WANDB_PROJECT"],
    entity: str = settings.SETTINGS["WANDB_ENTITY"],
) -> wandb.Artifact:
    """Get the latest version of a W&B artifact."""

    api = wandb.Api()
    artifact = api.artifact(f"{entity}/{project}/{artifact_name}:latest")

    return artifact
Get the latest version of a W&B artifact.
training-pipeline/training_pipeline/utils.py