This Python script offers a seamless and non-interruptible music generation experience using audiocraft musicgen models. The music generation utilizes the last seconds of the previously generated song to maintain a continuous flow.
- NVIDIA RTX 4090 GPU or higher for melody model
- Clone the audiocraft repo locally: git clone https://github.com/facebookresearch/audiocraft
- Navigate to the folder: cd audiocraft
- Create a venv environment: python -m venv myenv
- Activate your env: source env/bin/activate # On Windows use env\Scripts\activate
- Install requirements: pip install -r requirements.txt
- Install the latest torch cuda: Follow installation steps from here https://pytorch.org/get-started/locally/
- Download the infigen.py script to your audiocraft folder: Ensure to place it on the main folder
- Run the script: python infigen.py
- Modify music genre: Edit line 19