Model reference · open weights
univnet-dev is an open-weight embedding model from dg845. AxForge deploys and operates it for you on dedicated EU-owned hardware — with the licence handled where one is required.
Available as managed deployment — configured and operated for you on dedicated EU hardware, quoted per deployment.
What it is
| Released by | dg845 |
|---|---|
| Type | Embedding models |
| Task | Embeddings |
| Runs with | transformers |
| Released | 2023-07-13 |
| Popularity | 14k downloads / month |
| Licence | Open weights |
About
The UnivNet model is a state-of-the-art neural vocoder which synthesizes audio waveforms from full-band MEL spectrograms, introduced in "UnivNet: A Neural Vocoder with Multi-Resolution Spectrogram Discriminators for High-Fidelity Waveform Generation" by Won Jang, Dan Lim, Jaesam Yoon, Bongwan Kim, Juntae Kim. UnivNet is a generative adversarial network (GAN) in which the generator is trained to convert real (or fake, during training) log MEL spectrograms to waveforms, and the discriminator is trained to classify whether input waveforms are real or fake. From the original paper abstract:
Most neural vocoders employ band-limited mel-spectrograms to generate waveforms. If full-band spectral features are used as the input, the vocoder can be provided with as much acoustic information as possible. However, in some models employing full-band mel-spectrograms, an over-smoothing problem occurs as part of which non-sharp spectrograms are generated. To address this problem, we propose UnivNet, a neural vocoder that synthesizes high-fidelity waveforms in real time. Inspired by works in the field of voice activity detection, we added a multi-resolution spectrogram discriminator that employs multiple linear spectrogram magnitudes computed using various parameter sets. Using full-band mel-spectrograms as input, we expect to generate high-resolution signals by adding a discriminator that employs spectrograms of multiple resolutions as the input. In an evaluation on a dataset containing information on hundreds of speakers, UnivNet obtained the best objective and subjective results among competing models for both seen and unseen speakers. These results, including the best subjective score for text-to-speech, demonstrate the potential for fast adaptation to new speakers without a need for training from scratch.
Currently, only the generator/vocoder part of the model is implemented.
This checkpoint was released as part of an unofficial implementation by maum-ai (on which the transformers implementation is also based).
As far as I know, there is no official model or code release by the original authors from Kakao Enterprise.
The original PyTorch model checkpoints from the maum-ai/univnet implementation can be downloaded from their Github repo. Note that this checkpoint corresponds with their c32 checkpoint.
The transformers model and feature extractor (to prepare inputs for the model) can be downloaded as follows:
from transformers import UnivNetFeatureExtractor, UnivNetModel
model_id_or_path = "dg845/univnet-dev"
feature_extractor = UnivNetFeatureExtractor.from_pretrained(model_id_or_path)
model = UnivNetModel.from_pretrained(model_id_or_path)
The original model checkpoints can be used with the maum-ai/univnet codebase.
An example of using the UnivNet model with transformers is as follows:
import torch
from scipy.io.wavfile import write
from datasets import Audio, load_dataset
from transformers import UnivNetFeatureExtractor, UnivNetModel
model_id_or_path = "dg845/univnet-dev"
model = UnivNetModel.from_pretrained(model_id_or_path)
feature_extractor = UnivNetFeatureExtractor.from_pretrained(model_id_or_path)
ds = load_dataset("hf-internal-testing/librispeech_asr_dummy", "clean", split="validation")
# Resample the audio to the model and feature extractor's sampling rate.
ds = ds.cast_column("audio", Audio(sampling_rate=feature_extractor.sampling_rate))
# Pad the end of the converted waveforms to reduce artifacts at the end of the output audio samples.
inputs = feature_extractor(
ds[0]["audio"]["array"], sampling_rate=ds[0]["audio"]["sampling_rate"], pad_end=True, return_tensors="pt"
)
with torch.no_grad():
audio = model(**inputs)
# Remove the extra padding at the end of the output.
audio = feature_extractor.batch_decode(**audio)[0]
# Convert to wav file
write("sample_audio.wav", feature_extractor.sampling_rate, audio)
From the published model card. Full card on the HuggingFace links in the sidebar.
Using it via the API
Once AxForge deploys univnet-dev for you, it answers on the OpenAI-compatible API — the same base URL and keys as every other model. (univnet-dev below is illustrative; you get the exact model name on deployment.)
$ curl -sS https://api.axforge.ai/v1/embeddings \
-H "Authorization: Bearer $AXFORGE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"univnet-dev","input":"text to embed"}'
Create an account — your API key is available in the console. 3M free tokens every 30 days with every new account.