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

# Comment trouver les Artifacts enregistrés ou consommés par un run ? Comment trouver les runs qui ont produit ou consommé un artifact ?

W\&B suit les Artifacts enregistrés par chaque run ainsi que ceux utilisés par chaque run afin de construire un graphe d’Artifacts. Ce graphe est un graphe biparti orienté acyclique, dont les nœuds représentent des runs et des Artifacts. Vous pouvez en voir un exemple [ici](https://wandb.ai/shawn/detectron2-11/artifacts/dataset/furniture-small-val/06d5ddd4deeb2a6ebdd5/graph) (cliquez sur "Explode" pour déployer le graphe).

Utilisez l’API publique pour parcourir le graphe par code, à partir d’un artifact ou d’un run.

<Tabs>
  <Tab title="À partir d’un artifact">
    ```python theme={null}
    api = wandb.Api()

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

    # Remonter le graphe à partir d’un artifact :
    producer_run = artifact.logged_by()
    # Descendre le graphe à partir d’un artifact :
    consumer_runs = artifact.used_by()

    # Descendre le graphe à partir d’un run :
    next_artifacts = consumer_runs[0].logged_artifacts()
    # Remonter le graphe à partir d’un run :
    previous_artifacts = producer_run.used_artifacts()
    ```
  </Tab>

  <Tab title="À partir d’un run">
    ```python theme={null}
    api = wandb.Api()

    run = api.run("entity/project/run_id")

    # Descendre le graphe à partir d’un run :
    produced_artifacts = run.logged_artifacts()
    # Remonter le graphe à partir d’un run :
    consumed_artifacts = run.used_artifacts()

    # Remonter le graphe à partir d’un artifact :
    earlier_run = consumed_artifacts[0].logged_by()
    # Descendre le graphe à partir d’un artifact :
    consumer_runs = produced_artifacts[0].used_by()
    ```
  </Tab>
</Tabs>

***

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