Before running the script, make sure you install the library from source:
```bash
git clone https://github.com/huggingface/diffusers
cd diffusers
pip install -e .
```  
Then navigate to the example folder containing the training script and install the required dependencies for the script you're using:  
- PyTorch  
```bash
cd examples/cogvideo
pip install -r requirements.txt
```  
And initialize an [🤗 Accelerate](https://github.com/huggingface/accelerate/) environment with:  
```bash
accelerate config