Views
No views yet
Lumina Text-to-Audio is a music generation model developed based on FlagDiT. It uses T5-v1.1-XXL as the text encoder and Vocoder as the decoder.[!Warning] The current version of Lumina Text-to-Audio requires the use of structure caption for audio generation. We will soon release a version that does not require structure caption.
Lumina-T2Audio Checkpoints: huggingfaceLumina-T2Audio for text-to-audio generation.nvcc1# The command should work and show the same version number as in our case. (12.1 in our case).
2nvcc --versiongcc is available1# The command should work and show a version of at least 6.0.
2# If not, consult distro-specific tutorials to obtain a newer version or build manually.
3gcc --versiongit clone https://github.com/Alpha-VLLM/Lumina-T2X1conda create -n Lumina_T2X -y
2conda activate Lumina_T2X
3conda install python=3.11 pytorch==2.1.0 torchvision==0.16.0 torchaudio==2.1.0 pytorch-cuda=12.1 -c pytorch -c nvidia -y[!Warning] The environment dependencies for Lumina-T2Audio are different from those for Lumina-T2I. Please install the appropriate environment.
Lumina-T2Audio dependencies:1cd .. # If you are in the `lumina_audio` directory, execute this line.
2pip install -e ".[audio]"requirements.txt to install the environment.1cd lumina_audio # If you are not in the `lumina_audio` folder, run this line.
2pip install -r requirements.txtflash-attnpip install flash-attn --no-build-isolation[!Warning] While Apex can improve efficiency, it is not a must to make Lumina-T2X work.Note that Lumina-T2X works smoothly with either:
- Apex not installed at all; OR
- Apex successfully installed with CUDA and C++ extensions.
However, it will fail when:
- A Python-only build of Apex is installed.
If the errorNo module named 'fused_layer_norm_cuda'appears, it typically means you are using a Python-only build of Apex. To resolve this, please runpip uninstall apex, and Lumina-T2X should then function correctly.
1pip install ninja
2git clone https://github.com/NVIDIA/apex
3cd apex
4# if pip >= 23.1 (ref: https://pip.pypa.io/en/stable/news/#v23-1) which supports multiple `--config-settings` with the same key...
5pip install -v --disable-pip-version-check --no-cache-dir --no-build-isolation --config-settings "--build-option=--cpp_ext" --config-settings "--build-option=--cuda_ext" ./
6# otherwise
7pip install -v --disable-pip-version-check --no-cache-dir --no-build-isolation --global-option="--cpp_ext" --global-option="--cuda_ext" ./huggingface-cli downloading our model:huggingface-cli download --resume-download Alpha-VLLM/Lumina-T2Audio --local-dir /path/to/ckptgit clone https://huggingface.co/Alpha-VLLM/Lumina-T2AudioAutoencoderKL ckpt pathconfigs/lumina-text2audio.yaml to set AutoencoderKL checkpoint path. Please replace /path/to/ckpt with the path where your checkpoints are located (<real_ckpt_path>).1 ...
2 depth: 16
3 max_len: 1000
4
5 first_stage_config:
6 target: models.autoencoder1d.AutoencoderKL
7 params:
8 embed_dim: 20
9 monitor: val/rec_loss
10 - ckpt_path: /path/to/ckpt/maa2/maa2.ckpt
11 + ckpt_path: <real_ckpt_path>/maa2/maa2.ckpt
12 ddconfig:
13 double_z: true
14 in_channels: 80
15 out_ch: 80
16 ...
17 cond_stage_config:
18 target: models.encoders.modules.FrozenCLAPFLANEmbedder
19 params:
20 - weights_path: /path/to/ckpt/CLAP/CLAP_weights_2022.pth
21 + weights_path: <real_ckpt_path>/CLAP/CLAP_weights_2022.pth
22Lumina-T2Audio and Vocoder checkpoint path and run demo/path/to/ckpt with the actual downloaded path.1# `/path/to/ckpt` should be a directory containing `audio_generation`, `maa2`, and `bigvnat`.
2
3# default
4python -u demo_audio.py \
5 --ckpt "/path/to/ckpt/audio_generation" \
6 --vocoder_ckpt "/path/to/ckpt/bigvnat" \
7 --config_path "configs/lumina-text2audio.yaml" \
8 --sample_rate 16000run_audio.sh script for web demo after updating AutoencoderKL ckpt path on configs/lumina-text2audio.yaml, and updating --ckpt, and --vocoder_ckpt on run_audio.sh.n2s_openai.py:1- openai_key = 'your openai api key here'
2+ openai_key = '<your real openai api key>'base_url accordingly. The default setting uses OpenAI's base_url.1- base_url = ""
2+ base_url = "<your base url>"bash run_audio.sh