> ## 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 reprendre un balayage avec du code Python ?

Pour reprendre un balayage, passez le `sweep_id` à la fonction `wandb.agent()`.

```python theme={null}
import wandb

sweep_id = "your_sweep_id"

def train():
    # Code d'entraînement ici
    pass

wandb.agent(sweep_id=sweep_id, function=train)
```

***

<Badge stroke shape="pill" color="orange" size="md">[Sweeps](/fr/support/models/tags/sweeps)</Badge><Badge stroke shape="pill" color="orange" size="md">[Python](/fr/support/models/tags/python)</Badge>
