SAVRN
Search Contact SAVRN

Open-weight model · Audio to audio

bigvgan_v2_22khz_80band_256x

by NVIDIA nvidia/bigvgan_v2_22khz_80band_256x

[[Paper]](https://arxiv.org/abs/2206.04658) - [[Code]](https://github.com/NVIDIA/BigVGAN) - [[Showcase]](https://bigvgan-demo.github.io/) - [[Project Page]](https://research.nvidia.com/labs/adlr/projects/bigvgan/) …

Parameters
Context
Weights3.8 GB
Licensemit
AccessOpen weights
Monthly Downloads1.4M

Model Card

By NVIDIA, published under mit, revision 633ff708ed5b.

[[Paper]](https://arxiv.org/abs/2206.04658) - [[Code]](https://github.com/NVIDIA/BigVGAN) - [[Showcase]](https://bigvgan-demo.github.io/) - [[Project Page]](https://research.nvidia.com/labs/adlr/projects/bigvgan/) - [[Weights]](https://huggingface.co/collections/nvidia/bigvgan-66959df3d97fd7d98d97dc9a) - [[Demo]](https://huggingface.co/spaces/nvidia/BigVGAN) - General refactor and code improvements for improved readability. - Fully fused CUDA kernel of anti-alised activation (upsampling + activation + downsampling) with inference speed benchmark. - We provide pretrained checkpoints of BigVGAN-v2 using diverse audio configurations, supporting up to 44 kHz sampling rate and 512x upsampling…

Read NVIDIA's full model card

BigVGAN: A Universal Neural Vocoder with Large-Scale Training

Sang-gil Lee, Wei Ping, Boris Ginsburg, Bryan Catanzaro, Sungroh Yoon

[Paper] - [Code] - [Showcase] - [Project Page] - [Weights] - [Demo]

News

  • Jul 2024 (v2.3):
  • General refactor and code improvements for improved readability.
  • Fully fused CUDA kernel of anti-alised activation (upsampling + activation + downsampling) with inference speed benchmark.

  • Jul 2024 (v2.2): The repository now includes an interactive local demo using gradio.

  • Jul 2024 (v2.1):BigVGAN is now integrated with Hugging Face Hub with easy access to inference using pretrained checkpoints. We also provide an interactive demo on Hugging Face Spaces.

  • Jul 2024 (v2): We release BigVGAN-v2 along with pretrained checkpoints. Below are the highlights:

  • Custom CUDA kernel for inference: we provide a fused upsampling + activation kernel written in CUDA for accelerated inference speed. Our test shows 1.5 - 3x faster speed on a single A100 GPU.
  • Improved discriminator and loss: BigVGAN-v2 is trained using a multi-scale sub-band CQT discriminator and a multi-scale mel spectrogram loss.
  • Larger training data: BigVGAN-v2 is trained using datasets containing diverse audio types, including speech in multiple languages, environmental sounds, and instruments.
  • We provide pretrained checkpoints of BigVGAN-v2 using diverse audio configurations, supporting up to 44 kHz sampling rate and 512x upsampling ratio.

Installation

This repository contains pretrained BigVGAN checkpoints with easy access to inference and additional huggingface_hub support.

If you are interested in training the model and additional functionalities, please visit the official GitHub repository for more information: https://github.com/NVIDIA/BigVGAN

git lfs install
git clone https://huggingface.co/nvidia/bigvgan_v2_22khz_80band_256x

Usage

Below example describes how you can use BigVGAN: load the pretrained BigVGAN generator from Hugging Face Hub, compute mel spectrogram from input waveform, and generate synthesized waveform using the mel spectrogram as the model's input.

device = 'cuda'

import torch
import bigvgan
import librosa
from meldataset import get_mel_spectrogram

# instantiate the model. You can optionally set use_cuda_kernel=True for faster inference.
model = bigvgan.BigVGAN.from_pretrained('nvidia/bigvgan_v2_22khz_80band_256x', use_cuda_kernel=False)

# remove weight norm in the model and set to eval mode
model.remove_weight_norm()
model = model.eval().to(device)

# load wav file and compute mel spectrogram
wav_path = '/path/to/your/audio.wav'
wav, sr = librosa.load(wav_path, sr=model.h.sampling_rate, mono=True) # wav is np.ndarray with shape [T_time] and values in [-1, 1]
wav = torch.FloatTensor(wav).unsqueeze(0) # wav is FloatTensor with shape [B(1), T_time]

# compute mel spectrogram from the ground truth audio
mel = get_mel_spectrogram(wav, model.h).to(device) # mel is FloatTensor with shape [B(1), C_mel, T_frame]

# generate waveform from mel
with torch.inference_mode():
    wav_gen = model(mel) # wav_gen is FloatTensor with shape [B(1), 1, T_time] and values in [-1, 1]
wav_gen_float = wav_gen.squeeze(0).cpu() # wav_gen is FloatTensor with shape [1, T_time]

# you can convert the generated waveform to 16 bit linear PCM
wav_gen_int16 = (wav_gen_float * 32767.0).numpy().astype('int16') # wav_gen is now np.ndarray with shape [1, T_time] and int16 dtype

Using Custom CUDA Kernel for Synthesis

You can apply the fast CUDA inference kernel by using a parameter use_cuda_kernel when instantiating BigVGAN:

import bigvgan
model = bigvgan.BigVGAN.from_pretrained('nvidia/bigvgan_v2_22khz_80band_256x', use_cuda_kernel=True)

When applied for the first time, it builds the kernel using nvcc and ninja. If the build succeeds, the kernel is saved to alias_free_activation/cuda/build and the model automatically loads the kernel. The codebase has been tested using CUDA 12.1.

Please make sure that both are installed in your system and nvcc installed in your system matches the version your PyTorch build is using.

For detail, see the official GitHub repository: https://github.com/NVIDIA/BigVGAN?tab=readme-ov-file#using-custom-cuda-kernel-for-synthesis

Pretrained Models

We provide the pretrained models on Hugging Face Collections. One can download the checkpoints of the generator weight (named bigvgan_generator.pt) and its discriminator/optimizer states (named bigvgan_discriminator_optimizer.pt) within the listed model repositories.

Model Name Sampling Rate Mel band fmax Upsampling Ratio Params Dataset Steps Fine-Tuned
bigvgan_v2_44khz_128band_512x 44 kHz 128 22050 512 122M Large-scale Compilation 5M No
bigvgan_v2_44khz_128band_256x 44 kHz 128 22050 256 112M Large-scale Compilation 5M No
bigvgan_v2_24khz_100band_256x 24 kHz 100 12000 256 112M Large-scale Compilation 5M No
bigvgan_v2_22khz_80band_256x 22 kHz 80 11025 256 112M Large-scale Compilation 5M No
bigvgan_v2_22khz_80band_fmax8k_256x 22 kHz 80 8000 256 112M Large-scale Compilation 5M No
bigvgan_24khz_100band 24 kHz 100 12000 256 112M LibriTTS 5M No
bigvgan_base_24khz_100band 24 kHz 100 12000 256 14M LibriTTS 5M No
bigvgan_22khz_80band 22 kHz 80 8000 256 112M LibriTTS + VCTK + LJSpeech 5M No
bigvgan_base_22khz_80band 22 kHz 80 8000 256 14M LibriTTS + VCTK + LJSpeech 5M No

Identity and Version

Repository
nvidia/bigvgan_v2_22khz_80band_256x
Publisher
NVIDIA
Task
Audio to audio
Modality
Audio
Library
PyTorch
Parameters
Not stated by the source
Languages
Not stated by the source
Revision
633ff708ed5b74903e86ff1298cf4a98e921c513
First published
2024-07-15
Last updated
2024-09-05

Files and Weights

31 files, 3.8 GB in total. The weights are 4 files totalling 3.8 GB in pt.

Weights4 files · 3.8 GB
Configuration13 files · 49.4 KB
Documentation7 files · 25.4 KB
Other4 files · 18.0 KB
Repository3 files · 3.2 KB
Every file
FileTypeSizeSHA-256
bigvgan_discriminator_optimizer.ptWeights1.4 GB 2d0960ae4abe
bigvgan_discriminator_optimizer_3msteps.ptWeights1.4 GB 3a6179837741
bigvgan_generator.ptWeights449.2 MB e95ba25972d3
bigvgan_generator_3msteps.ptWeights449.2 MB ee7862b70ad7
activations.pyConfiguration4.5 KB
alias_free_activation/cuda/__init__.pyConfiguration
alias_free_activation/cuda/activation1d.pyConfiguration2.6 KB
alias_free_activation/cuda/load.pyConfiguration2.6 KB
alias_free_activation/torch/__init__.pyConfiguration200 B
alias_free_activation/torch/act.pyConfiguration852 B
alias_free_activation/torch/filter.pyConfiguration3.4 KB
alias_free_activation/torch/resample.pyConfiguration1.9 KB
bigvgan.pyConfiguration17.5 KB
config.jsonConfiguration1.4 KB
env.pyConfiguration510 B
meldataset.pyConfiguration11.4 KB
utils.pyConfiguration2.6 KB
LICENSEDocumentation1.1 KB
README.mdDocumentation8.0 KB
nv-modelcard++/bias.mdDocumentation664 B
nv-modelcard++/explainability.mdDocumentation4.2 KB
nv-modelcard++/overview.mdDocumentation7.2 KB
nv-modelcard++/privacy.mdDocumentation2.6 KB
nv-modelcard++/safety.mdDocumentation1.6 KB
alias_free_activation/cuda/anti_alias_activation.cppOther977 B
alias_free_activation/cuda/anti_alias_activation_cuda.cuOther10.3 KB
alias_free_activation/cuda/compat.hOther893 B
alias_free_activation/cuda/type_shim.hOther5.8 KB
.gitattributesRepository1.5 KB
.gitignoreRepository1.6 KB
nv-modelcard++/.gitkeepRepository

License and Download

License
mit
Access
Open weights, no gate
Download size
3.8 GB
Download from NVIDIA

Released by NVIDIA through its official repository on Hugging Face. Read the license.

Built From

Memory Requirements

PrecisionWeights in memory
As published3.8 GB

Weights only, from the published parameter count; the key-value cache and runtime add to this.

Questions About bigvgan_v2_22khz_80band_256x

Can I use bigvgan_v2_22khz_80band_256x commercially?

Yes. bigvgan_v2_22khz_80band_256x is released under MIT License. The MIT License is a short permissive license. It permits commercial use, modification and redistribution, provided the copyright notice and permission notice are included.

Similar Models

Model · Audio to audio

bigvgan_v2_44khz_128band_512x

NVIDIA

[[Paper]](https://arxiv.org/abs/2206.04658) - [[Code]](https://github.com/NVIDIA/BigVGAN) - [[Showcase]](https://bigvgan-demo.github.io/) - [[Project Page]](https://research.nvidia.com/labs/adlr/projects/bigvgan/) - [[Weights]](https://huggingface.co/collections/nvidia/bigvgan-66959df3d97fd7d98d97dc9a) - [[Demo]](https://huggingface.co/spaces/nvidia/BigVGAN) - General refactor and code improvements for improved readability. - Fully fused CUDA kernel of anti-alised activation (upsampling + activation + downsampling) with inference speed benchmark. - We provide pretrained checkpoints of BigVGAN-v2 using diverse audio configurations, supporting up to 44 kHz sampling rate and 512x upsampling…

Open weights mit PyTorch