메인 콘텐츠로 건너뛰기
alias를 특정 버전을 가리키는 포인터로 사용하세요. 기본적으로 wandb.Run.log_artifact()는 로깅된 버전에 latest alias를 추가합니다. W&B는 artifact를 처음 로깅할 때 artifact 버전 v0를 생성하고 이를 해당 artifact에 연결합니다. 같은 artifact에 다시 로깅하면 W&B는 콘텐츠의 체크섬을 확인합니다. artifact가 변경되었다면 W&B는 새 버전 v1을 저장합니다. 예를 들어, 트레이닝 스크립트가 데이터셋의 최신 버전을 가져오도록 하려면 해당 artifact를 사용할 때 latest를 지정하세요. 다음 코드 예제는 latest alias가 지정된 bike-dataset 최신 데이터셋 artifact를 다운로드하는 방법을 보여줍니다.
import wandb

with wandb.init(project="<project>") as run:
    artifact = run.use_artifact("bike-dataset:latest")
    artifact.download()
artifact 버전에 맞춤형 alias를 적용할 수도 있습니다. 예를 들어, model checkpoint가 metric AP-50에서 가장 우수하다는 것을 표시하려면 모델 artifact를 로깅할 때 'best-ap50' 문자열을 alias로 추가할 수 있습니다.
with wandb.init(project="<project>") as run:
    artifact = wandb.Artifact("run-3nq3ctyy-bike-model", type="model")
    artifact.add_file("model.h5")
    run.log_artifact(artifact, aliases=["latest", "best-ap50"])