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

# Update an artifact

> W&B Run 안팎에서 기존 아티팩트 를 업데이트합니다.

원하는 값을 전달하여 아티팩트의 `description`, `metadata`, 그리고 `alias`를 업데이트하세요. W\&B 서버에서 아티팩트를 업데이트하려면 `save()` 메서드를 호출하세요. W\&B Run 도중 또는 Run 외부에서 아티팩트를 업데이트할 수 있습니다.

Run 외부에서 아티팩트를 업데이트하려면 W\&B Public API([`wandb.Api`](/ko/models/ref/python/public-api/api))를 사용하세요. Run 도중에 아티팩트를 업데이트하려면 Artifact API([`wandb.Artifact`](/ko/models/ref/python/artifact))를 사용하세요.

<Warning>
  Model Registry의 모델에 연결된 아티팩트의 에일리어스 는 업데이트할 수 없습니다.
</Warning>

<Tabs>
  <Tab title="Run 도중">
    다음 코드 예제는 [`wandb.Artifact`](/ko/models/ref/python/artifact) API를 사용하여 아티팩트의 설명을 업데이트하는 방법을 보여줍니다:

    ```python theme={null}
    import wandb

    run = wandb.init(project="<example>")
    artifact = run.use_artifact("<artifact-name>:<alias>")
    artifact.description = "<description>"
    artifact.save()
    ```
  </Tab>

  <Tab title="Run 외부">
    다음 코드 예제는 `wandb.Api` API를 사용하여 아티팩트의 설명을 업데이트하는 방법을 보여줍니다:

    ```python theme={null}
    import wandb

    api = wandb.Api()

    artifact = api.artifact("entity/project/artifact:alias")

    # Update the description
    artifact.description = "My new description"

    # Selectively update metadata keys
    artifact.metadata["oldKey"] = "new value"

    # Replace the metadata entirely
    artifact.metadata = {"newKey": "new value"}

    # Add an alias
    artifact.aliases.append("best")

    # Remove an alias
    artifact.aliases.remove("latest")

    # Completely replace the aliases
    artifact.aliases = ["replaced"]

    # Persist all artifact modifications
    artifact.save()
    ```

    자세한 내용은 Weights and Biases [Artifact API](/ko/models/ref/python/artifact)를 참조하십시오.
  </Tab>

  <Tab title="컬렉션 사용">
    단일 아티팩트와 같은 방식으로 Artifact 컬렉션을 업데이트할 수도 있습니다:

    ```python theme={null}
    import wandb
    run = wandb.init(project="<example>")
    api = wandb.Api()
    artifact = api.artifact_collection(type="<type-name>", collection="<collection-name>")
    artifact.name = "<new-collection-name>"
    artifact.description = "<This is where you'd describe the purpose of your collection.>"
    artifact.save()
    ```

    자세한 내용은 [Artifacts Collection](/ko/models/ref/python/public-api/api) 레퍼런스를 참조하십시오.
  </Tab>
</Tabs>
