> ## Documentation Index
> Fetch the complete documentation index at: https://docs.wandb.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# 既存のrunにartifactをログするにはどうすればよいですか？

artifactを、過去にログしたrunの出力としてマークする必要がある場合があります。たとえば、以前のトレーニング runに関連付けるべき新しいモデル チェックポイントやデータセットを生成することがあります。次のコードは、IDでrunを再初期化し、それに新しいartifactをログします。

```python theme={null}
with wandb.init(id="existing_run_id", resume="allow") as run:
    artifact = wandb.Artifact("artifact_name", "artifact_type")
    artifact.add_file("my_data/file.txt")
    run.log_artifact(artifact)
```

***

<Badge stroke shape="pill" color="orange" size="md">[Artifacts](/ja/support/models/tags/artifacts)</Badge>
