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 深度學習容器
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 應用。