Boson AI开源的文本音频基础模型,基于1000万小时音频数据预训练,支持表现力丰富的语音合成和多语言音频生成
Higgs Audio V2 项目详细介绍
项目概述
Higgs Audio V2 是 Boson AI 开源的强大音频基础模型,基于超过1000万小时的音频数据和多样化的文本数据进行预训练。尽管没有进行后训练或微调,Higgs Audio V2 在表现力丰富的音频生成方面表现卓越,这得益于其深度的语言和声学理解能力。
核心特性
1. 强大的语音合成能力
- 支持富有表现力的语音生成
- 多语言音频生成支持
- 自然的多说话人对话生成
- 自动韵律适应叙述
- 用克隆语音进行旋律哼唱
- 同时生成语音和背景音乐
2. 卓越的性能表现
在 EmergentTTS-Eval 评测中,该模型在"情感"和"问题"类别上分别获得了 75.7% 和 55.7% 的胜率,超越了"gpt-4o-mini-tts"。同时在传统的 TTS 基准测试如 Seed-TTS Eval 和情感语音数据集 (ESD) 上也获得了业界领先的性能。
3. 独特的涌现能力
该模型展现了以前系统中很少见的能力:
- 生成自然的多语言多说话人对话
- 叙述过程中的自动韵律适应
- 使用克隆语音进行旋律哼唱
- 同时生成语音和背景音乐
技术架构
核心技术创新
自动化标注管道:利用多个 ASR 模型、声音事件分类模型和内部音频理解模型,清理并标注了1000万小时的音频数据(称为 AudioVerse)
统一音频分词器:从零开始训练的统一音频分词器,能够捕获语义和声学特征
DualFFN 架构:增强了 LLM 建模声学标记的能力,同时保持最小的计算开销
环境配置
推荐的 Docker 环境
# 使用 NVIDIA Deep Learning Container
docker run --gpus all --ipc=host --net=host --ulimit memlock=-1 --ulimit stack=67108864 -it --rm nvcr.io/nvidia/pytorch:25.02-py3 bash
标准安装方式
使用 Git + pip
git clone https://github.com/boson-ai/higgs-audio.git
cd higgs-audio
pip install -r requirements.txt
pip install -e .
使用虚拟环境
git clone https://github.com/boson-ai/higgs-audio.git
cd higgs-audio
python3 -m venv higgs_audio_env
source higgs_audio_env/bin/activate
pip install -r requirements.txt
pip install -e .
使用 Conda
git clone https://github.com/boson-ai/higgs-audio.git
cd higgs-audio
conda create -n higgs_audio_env python=3.10
conda activate higgs_audio_env
pip install -r requirements.txt
pip install -e .
使用 uv
git clone https://github.com/boson-ai/higgs-audio.git
cd higgs-audio
uv venv --python 3.10
source .venv/bin/activate
uv pip install -r requirements.txt
uv pip install -e .
使用示例
基础 Python 代码示例
from boson_multimodal.serve.serve_engine import HiggsAudioServeEngine, HiggsAudioResponse
from boson_multimodal.data_types import ChatMLSample, Message, AudioContent
import torch
import torchaudio
import time
import click
MODEL_PATH = "bosonai/higgs-audio-v2-generation-3B-base"
AUDIO_TOKENIZER_PATH = "bosonai/higgs-audio-v2-tokenizer"
system_prompt = (
"Generate audio following instruction.\n\n<|scene_desc_start|>\nAudio is recorded from a quiet room.\n<|scene_desc_end|>"
)
messages = [
Message(
role="system",
content=system_prompt,
),
Message(
role="user",
content="The sun rises in the east and sets in the west. This simple fact has been observed by humans for thousands of years.",
),
]
device = "cuda" if torch.cuda.is_available() else "cpu"
serve_engine = HiggsAudioServeEngine(MODEL_PATH, AUDIO_TOKENIZER_PATH, device=device)
output: HiggsAudioResponse = serve_engine.generate(
chat_ml_sample=ChatMLSample(messages=messages),
max_new_tokens=1024,
temperature=0.3,
top_p=0.95,
top_k=50,
stop_strings=["<|end_of_text|>", "<|eot_id|>"],
)
torchaudio.save(f"output.wav", torch.from_numpy(output.audio)[None, :], output.sampling_rate)
命令行使用示例
使用参考音频生成语音
python3 examples/generation.py \
--transcript "The sun rises in the east and sets in the west. This simple fact has been observed by humans for thousands of years." \
--ref_audio belinda \
--temperature 0.3 \
--out_path generation.wav
不使用参考音频(模型自动决定声音)
python3 examples/generation.py \
--transcript "The sun rises in the east and sets in the west. This simple fact has been observed by humans for thousands of years." \
--temperature 0.3 \
--out_path generation.wav
生成多说话人对话
python3 examples/generation.py \
--transcript examples/transcript/multi_speaker/en_argument.txt \
--seed 12345 \
--out_path generation.wav
使用指定声音生成多说话人对话
python3 examples/generation.py \
--transcript examples/transcript/multi_speaker/en_argument.txt \
--ref_audio belinda,broom_salesman \
--ref_audio_in_system_message \
--chunk_method speaker \
--seed 12345 \
--out_path generation.wav
性能评测结果
传统 TTS 基准测试
SeedTTS-Eval 和 ESD 评测结果
模型 | SeedTTS-Eval | ESD | ||
---|---|---|---|---|
WER ↓ | SIM ↑ | WER ↓ | SIM (emo2vec) ↑ | |
Cosyvoice2 | 2.28 | 65.49 | 2.71 | 80.48 |
Qwen2.5-omni† | 2.33 | 64.10 | - | - |
ElevenLabs Multilingual V2 | 1.43 | 50.00 | 1.66 | 65.87 |
Higgs Audio v1 | 2.18 | 66.27 | 1.49 | 82.84 |
Higgs Audio v2 (base) | 2.44 | 67.70 | 1.78 | 86.13 |
EmergentTTS-Eval 评测
模型 | 情感 (%) ↑ | 问题 (%) ↑ |
---|---|---|
Higgs Audio v2 (base) | 75.71% | 55.71% |
多说话人评测
该项目还设计了专门的多说话人评测基准,包含三个子集:
two-speaker-conversation
:1000个合成对话,涉及两个说话人small talk (no ref)
:250个合成对话,特点是短话语和有限的轮次small talk (ref)
:250个类似的合成对话,包含更短的话语
硬件要求
重要提示:为了获得最佳性能,建议在配备至少 24GB 显存的 GPU 机器上运行生成示例。
高级功能
vLLM API 服务器
项目还提供了基于 vLLM 引擎的 OpenAI 兼容 API 服务器,用于高吞吐量的高级用法。详细信息请参考 examples/vllm
目录。
自定义音频分词器
项目引入了新的离散化音频分词器,运行频率仅为每秒25帧,同时保持甚至改善了音频质量,相比于两倍比特率的分词器。该模型是首个在24 kHz数据上训练的统一系统,涵盖语音、音乐和声音事件。
项目意义
随着开源版本的发布,Higgs Audio V2 邀请全球开发者参与塑造人机交互的未来。当您生成第一个样本时,您听到的不仅仅是合成语音——您正在体验语音技术的下一个进化阶段。
Higgs Audio V2 代表了音频生成技术的重要突破,为开发者和研究人员提供了强大的工具来探索和创新音频AI应用。