> ## Documentation Index
> Fetch the complete documentation index at: https://wb-21fd5541-sdk-testing-latest.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

> W&B Artifacts Overview, 작동 방식, 그리고 사용 시작 방법.

# Artifacts Overview

export const TryProductLink = ({url}) => <a href={url} target="_blank" rel="noopener noreferrer" className="github-source-link">
    <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" xmlns="http://www.w3.org/2000/svg">
      <line x1="4" y1="21" x2="4" y2="14"></line>
      <line x1="4" y1="10" x2="4" y2="3"></line>
      <line x1="12" y1="21" x2="12" y2="12"></line>
      <line x1="12" y1="8" x2="12" y2="3"></line>
      <line x1="20" y1="21" x2="20" y2="16"></line>
      <line x1="20" y1="12" x2="20" y2="3"></line>
      <circle cx="4" cy="12" r="2"></circle>
      <circle cx="12" cy="10" r="2"></circle>
      <circle cx="20" cy="14" r="2"></circle>
    </svg>
    W&amp;B에서 사용해 보기
  </a>;

export const ColabLink = ({url}) => <a href={url} target="_blank" rel="noopener noreferrer" className="colab-link">
    <svg width="20" height="20" viewBox="0 0 24 24" fill="currentColor" xmlns="http://www.w3.org/2000/svg">
      <path d="M14.25.18l.9.2.73.26.59.3.45.32.34.34.25.34.16.33.1.3.04.26.02.2-.01.13V8.5l-.05.63-.13.55-.21.46-.26.38-.3.31-.33.25-.35.19-.35.14-.33.1-.3.07-.26.04-.21.02H8.77l-.69.05-.59.14-.5.22-.41.27-.33.32-.27.35-.2.36-.15.37-.1.35-.07.32-.04.27-.02.21v3.06H3.17l-.21-.03-.28-.07-.32-.12-.35-.18-.36-.26-.36-.36-.35-.46-.32-.59-.28-.73-.21-.88-.14-1.05-.05-1.23.06-1.22.16-1.04.24-.87.32-.71.36-.57.4-.44.42-.33.42-.24.4-.16.36-.1.32-.05.24-.01h.16l.06.01h8.16v-.83H6.18l-.01-2.75-.02-.37.05-.34.11-.31.17-.28.25-.26.31-.23.38-.2.44-.18.51-.15.58-.12.64-.1.71-.06.77-.04.84-.02 1.27.05zm-6.3 1.98l-.23.33-.08.41.08.41.23.34.33.22.41.09.41-.09.33-.22.23-.34.08-.41-.08-.41-.23-.33-.33-.22-.41-.09-.41.09zm13.09 3.95l.28.06.32.12.35.18.36.27.36.35.35.47.32.59.28.73.21.88.14 1.04.05 1.23-.06 1.23-.16 1.04-.24.86-.32.71-.36.57-.4.45-.42.33-.42.24-.4.16-.36.09-.32.05-.24.02-.16-.01h-8.22v.82h5.84l.01 2.76.02.36-.05.34-.11.31-.17.29-.25.25-.31.24-.38.2-.44.17-.51.15-.58.13-.64.09-.71.07-.77.04-.84.01-1.27-.04-1.07-.14-.9-.2-.73-.25-.59-.3-.45-.33-.34-.34-.25-.34-.16-.33-.1-.3-.04-.25-.02-.2.01-.13v-5.34l.05-.64.13-.54.21-.46.26-.38.3-.32.33-.24.35-.2.35-.14.33-.1.3-.06.26-.04.21-.02.13-.01h5.84l.69-.05.59-.14.5-.21.41-.28.33-.32.27-.35.2-.36.15-.36.1-.35.07-.32.04-.28.02-.21V6.07h2.09l.14.01.21.03zm-6.47 14.25l-.23.33-.08.41.08.41.23.33.33.23.41.08.41-.08.33-.23.23-.33.08-.41-.08-.41-.23-.33-.33-.23-.41-.08-.41.08z" />
    </svg>
    Colab에서 사용해 보기
  </a>;

<CardGroup cols={4}>
  <ColabLink url="https://colab.research.google.com/github/wandb/examples/blob/master/colabs/wandb-artifacts/Pipeline_Versioning_with_W&B_Artifacts.ipynb" />

  <TryProductLink url="https://wandb.ai/wandb/arttest/artifacts/model/iv3_trained/5334ab69740f9dda4fed/lineage" />
</CardGroup>

W\&B Artifacts를 사용해 [W\&B Runs](/ko/models/runs)의 입력 및 출력으로 사용되는 데이터를 추적하고 버전 관리하세요. 예를 들어, 모델 트레이닝 run은 입력으로 데이터셋을 받아 출력으로 트레이닝된 모델을 생성할 수 있습니다. 하이퍼파라미터, 메타데이터, 메트릭을 run에 기록할 수 있으며, artifact를 사용해 모델 트레이닝에 사용된 데이터셋을 입력으로 기록, 추적, 버전 관리하고, 결과로 생성된 모델 checkpoint를 출력으로 기록할 수 있습니다.

<div id="use-cases">
  ## 사용 사례
</div>

전체 ML 워크플로 전반에서 아티팩트를 [runs](/ko/models/runs)의 입력과 출력으로 사용할 수 있습니다. 처리 작업의 입력으로 데이터셋, 모델, 또는 다른 아티팩트를 사용할 수도 있습니다.

<Frame>
  <img src="https://mintcdn.com/wb-21fd5541-sdk-testing-latest/VXcq5xVRfdCSVRpI/images/artifacts/artifacts_landing_page2.png?fit=max&auto=format&n=VXcq5xVRfdCSVRpI&q=85&s=fca985abf8ec209bb0be7bb259e79abf" alt="모델 트레이닝, 데이터 처리, 모델 평가를 위한 입력과 출력이 포함된 아티팩트 워크플로 다이어그램" width="1991" height="503" data-path="images/artifacts/artifacts_landing_page2.png" />
</Frame>

| 사용 사례    | 입력                  | 출력                              |
| -------- | ------------------- | ------------------------------- |
| 모델 트레이닝  | 데이터셋(트레이닝 및 검증 데이터) | 트레이닝된 모델                        |
| 데이터셋 전처리 | 데이터셋(원시 데이터)        | 데이터셋(전처리된 데이터)                  |
| 모델 평가    | 모델 + 데이터셋(테스트 데이터)  | [W\&B Table](/ko/models/tables) |
| 모델 최적화   | 모델                  | 최적화된 모델                         |

<Note>
  다음 코드 스니펫은 순서대로 실행해야 합니다.
</Note>

<div id="create-an-artifact">
  ## artifact 만들기
</div>

네 줄의 코드로 artifact를 만들 수 있습니다:

1. [W\&B run](/ko/models/runs)을 생성하세요.
2. [`wandb.Artifact`](/ko/models/ref/python/experiments/artifact)를 사용해 artifact 객체를 생성하세요.
3. `wandb.Artifact.add_file()`로 모델 파일이나 데이터셋 같은 파일을 하나 이상 artifact 객체에 추가하세요.
4. `wandb.Run.log_artifact()`로 artifact를 W\&B에 기록하세요.

예를 들어, 다음 코드 스니펫은 `dataset.h5`라는 파일을 `example_artifact`라는 artifact에 기록하는 방법을 보여줍니다:

```python theme={null}
import wandb

with wandb.init(project="artifacts-example", job_type="add-dataset") as run:
    artifact = wandb.Artifact(name="example_artifact", type="dataset")
    artifact.add_file(local_path="./dataset.h5", name="training_dataset")
    run.log_artifact(artifact)
```

* artifact의 `유형`은 W\&B 플랫폼에서 artifact가 어떻게 표시되는지에 영향을 줍니다. `유형`을 지정하지 않으면 기본값은 `unspecified`입니다.
* 드롭다운의 각 라벨은 서로 다른 `type` 매개변수 값을 나타냅니다. 위 코드 스니펫에서 artifact의 `유형`은 `dataset`입니다.

<Note>
  Amazon S3 버킷과 같은 외부 객체 저장소에 저장된 파일 또는 디렉터리에 레퍼런스를 추가하는 방법은 [외부 파일 추적](/ko/models/artifacts/track-external-files) 페이지를 참조하세요.
</Note>

<div id="download-an-artifact">
  ## artifact 다운로드
</div>

[`wandb.Run.use_artifact()`](/ko/models/ref/python/experiments/run#use_artifact) 메서드를 사용해 run의 입력으로 표시할 artifact를 지정합니다.

이전 코드 스니펫에 이어, 다음 코드 예제는 앞서 생성한 `example_artifact`라는 artifact를 사용하는 방법을 보여줍니다:

```python theme={null}
with wandb.init(project="artifacts-example", job_type="add-dataset") as run:
    artifact = run.use_artifact("training_dataset:latest")  # "my_data" artifact를 사용하는 run 객체를 반환합니다
```

이는 artifact 객체를 반환합니다.

다음으로, 반환된 객체를 사용해 artifact의 모든 내용을 다운로드하세요:

```python theme={null}
datadir = artifact.download()  # 전체 `my_data` artifact를 기본 디렉토리에 다운로드합니다.
```

<Note>
  특정 디렉터리에 artifact를 다운로드하려면 `root` [매개변수](/ko/models/ref/python/experiments/artifact)에 맞춤형 경로를 전달하면 됩니다. artifact를 다운로드하는 다른 방법과 추가 매개변수는 [artifact 다운로드 및 사용](/ko/models/artifacts/download-and-use-an-artifact) 가이드를 참조하세요.
</Note>

<div id="next-steps">
  ## 다음 단계
</div>

* 아티팩트를 [버전 관리](/ko/models/artifacts/create-a-new-artifact-version)하고 [업데이트](/ko/models/artifacts/update-an-artifact)하는 방법을 알아보세요.
* [automations](/ko/models/automations)를 사용해 아티팩트가 변경될 때 다운스트림 워크플로를 트리거하거나 Slack 채널로 알림을 받는 방법을 알아보세요.
* 학습된 모델을 보관하는 공간인 [레지스트리](/ko/models/registry)에 대해 알아보세요.
* [Python SDK](/ko/models/ref/python/experiments/artifact) 및 [CLI](/ko/models/ref/cli/wandb-artifact) 레퍼런스 가이드를 살펴보세요.
