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

# Comment puis-je enregistrer le code ?‌

Utilisez `save_code=True` dans `wandb.init` pour enregistrer le script principal ou le notebook qui lance le run. Pour enregistrer tout le code d’un run, gérez les versions du code avec Artifacts. L’exemple suivant montre ce processus :

```python theme={null}
code_artifact = wandb.Artifact(type="code")
code_artifact.add_file("./train.py")
wandb.log_artifact(code_artifact)
```

***

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