def check_if_artifact_exists(
    artifact_name: str,
    project: str = settings.SETTINGS["WANDB_PROJECT"],
    entity: str = settings.SETTINGS["WANDB_ENTITY"],
) -> bool:
    """Utiliy function that checks if a W&B artifact exists."""

    try:
        get_artifact(artifact_name, project, entity)

        return True
    except wandb.errors.CommError:
        return False
Utiliy function that checks if a W&B artifact exists.
training-pipeline/training_pipeline/utils.py