OmniVoice

提供商k2-fsa
分类text-to-speech
许可证Apache-2.0
下载量5.4K
星标28

简介

OmniVoice 是一款由 k2-fsa 推出的开源语音合成(TTS)模型。它主打高保真的声音克隆能力,能够通过极短的音频样本快速捕捉说话人的音色和情感细节,生成的语音自然度较高,有效缓解了传统 TTS 常见的“机器感”。对于开发者而言,该模型采用 Apache-2.0 协议,部署门槛较低,非常适合用于构建个性化 AI 助手、有声书制作或游戏角色配音等需要特定音色还原的场景。相比于闭源的商业 API,它为追求私有化部署和定制化声音的用户提供了灵活的替代方案。

核心亮点

  • 极少样本即可实现高保真音色克隆
  • 开源 Apache-2.0 协议,支持私有化部署
  • 语音自然度高,有效还原说话人情感
  • 适用于 AI 助手、有声书等个性化配音场景

使用方法

安装依赖
# 安装 Hugging Face transformers
pip install transformers torch
SDK 使用
# 使用 transformers 加载模型
from transformers import AutoModel, AutoTokenizer

model = AutoModel.from_pretrained("k2-fsa/OmniVoice")
tokenizer = AutoTokenizer.from_pretrained("k2-fsa/OmniVoice")

Hugging Face 下载

我们推荐使用命令行或者 Hugging Face Hub SDK 来进行模型的下载。

操作指引:在下载前,请先通过如下命令安装 huggingface_hub:

操作指引
pip install -U huggingface_hub

命令行下载

下载完整模型库

下载完整模型库
huggingface-cli download k2-fsa/OmniVoice

下载单个文件到指定本地文件夹(以下载 config.json 到当前路径下 ./dir 目录为例)

下载单个文件到指定本地文件夹(以下载 config.json 到当前路径下 ./dir 目录为例)
huggingface-cli download k2-fsa/OmniVoice config.json --local-dir ./dir

更多命令行下载选项,可参见官方文档

SDK 下载

SDK 下载
# 模型下载
from huggingface_hub import snapshot_download
model_dir = snapshot_download('k2-fsa/OmniVoice')

Git 下载

请确保 lfs 已经被正确安装

Git 下载
git lfs install
git clone https://huggingface.co/k2-fsa/OmniVoice

如果您希望跳过 lfs 大文件下载,可以使用如下命令

跳过 LFS
GIT_LFS_SKIP_SMUDGE=1 git clone https://huggingface.co/k2-fsa/OmniVoice

模型文件托管在 Hugging Face Hub,使用 HF CLI / SDK / Git 直接下载,不经过本站。

PyTorch / Transformers 使用

安装 Transformers

安装 Transformers
pip install -U transformers torch

模型加载和推理

模型加载和推理
from transformers import AutoModelForCausalLM, AutoTokenizer

model = AutoModelForCausalLM.from_pretrained('k2-fsa/OmniVoice')
tokenizer = AutoTokenizer.from_pretrained('k2-fsa/OmniVoice')

模型下载

我们推荐使用命令行或者 ModelScope SDK 来进行模型的下载。

操作指引:在下载前,请先通过如下命令安装 ModelScope:

操作指引
pip install modelscope

命令行下载

下载完整模型库

下载完整模型库
modelscope download --model k2-fsa/OmniVoice

下载单个文件到指定本地文件夹(以下载 README.md 到当前路径下 dir 目录为例)

下载单个文件到指定本地文件夹(以下载 README.md 到当前路径下 dir 目录为例)
modelscope download --model k2-fsa/OmniVoice README.md --local_dir ./dir

更多更丰富的命令行下载选项,可参见具体文档

SDK 下载

SDK 下载
# 模型下载
from modelscope import snapshot_download
model_dir = snapshot_download('k2-fsa/OmniVoice')

Git 下载

请确保 lfs 已经被正确安装

Git 下载
git lfs install
git clone https://www.modelscope.cn/k2-fsa/OmniVoice.git

如果您希望跳过 lfs 大文件下载,可以使用如下命令

跳过 LFS
GIT_LFS_SKIP_SMUDGE=1 git clone https://www.modelscope.cn/k2-fsa/OmniVoice.git

ModelScope 模型页直接下载模型文件;无需将模型文件放在本站服务器。

Notebook 快速开发

下载并安装 ModelScope library

下载并安装 ModelScope library
pip install "modelscope[audio,cv,nlp,multi-modal,science]" -f https://modelscope.oss-cn-beijing.aliyuncs.com/releases/repo.html

模型加载和推理

模型加载和推理
from modelscope.pipelines import pipeline
from modelscope.utils.constant import Tasks

p = pipeline('text-generation', 'k2-fsa/OmniVoice')

完整文档

来源: HuggingFace

---
base_model:

  • Qwen/Qwen3-0.6B

language:
  • aae

  • aal

  • aao

  • ab

  • abb

  • abn

  • abr

  • abs

  • abv

  • acm

  • acw

  • acx

  • adf

  • adx

  • ady

  • aeb

  • aec

  • af

  • afb

  • afo

  • ahl

  • ahs

  • ajg

  • aju

  • ala

  • aln

  • alo

  • am

  • amu

  • an

  • anc

  • ank

  • anp

  • anw

  • aom

  • apc

  • apd

  • arb

  • arq

  • ars

  • ary

  • arz

  • as

  • ast

  • avl

  • awo

  • ayl

  • ayp

  • az

  • ba

  • bag

  • bas

  • bax

  • bba

  • bbj

  • bbl

  • bbu

  • bce

  • bci

  • bcs

  • bcy

  • bda

  • bde

  • bdm

  • be

  • beb

  • bew

  • bfd

  • bft

  • bg

  • bgp

  • bhb

  • bhh

  • bho

  • bhp

  • bhr

  • bjj

  • bjk

  • bjn

  • bjt

  • bkh

  • bkm

  • bky

  • bmm

  • bmq

  • bn

  • bnm

  • bnn

  • bns

  • bo

  • bou

  • bqg

  • br

  • bra

  • brh

  • bri

  • brx

  • bs

  • bsh

  • bsj

  • bsk

  • btm

  • btv

  • bug

  • bum

  • buo

  • bux

  • bwr

  • bxf

  • byc

  • bys

  • byv

  • byx

  • bzc

  • bzw

  • ca

  • ccg

  • ceb

  • cen

  • cfa

  • cgg

  • chq

  • cjk

  • ckb

  • ckl

  • ckr

  • cky

  • cnh

  • cpy

  • cs

  • cte

  • ctl

  • cut

  • cux

  • cv

  • cy

  • da

  • dag

  • dar

  • dav

  • dbd

  • dcc

  • de

  • deg

  • dgh

  • dgo

  • dje

  • dmk

  • dml

  • dru

  • dty

  • dua

  • dv

  • dyu

  • dzg

  • ebr

  • ebu

  • ego

  • eiv

  • eko

  • ekr

  • el

  • elm

  • en

  • eo

  • es

  • esu

  • et

  • eto

  • ets

  • etu

  • eu

  • ewo

  • ext

  • eyo

  • fa

  • fan

  • fat

  • ff

  • ffm

  • fi

  • fia

  • fil

  • fip

  • fkk

  • fmp

  • fr

  • fub

  • fuc

  • fue

  • fuf

  • fuh

  • fui

  • fuq

  • fuv

  • fy

  • ga

  • gbm

  • gbr

  • gby

  • gcc

  • gdf

  • gej

  • ges

  • ggg

  • gid

  • gig

  • giz

  • gjk

  • gju

  • gl

  • glw

  • gn

  • gol

  • gom

  • gsl

  • gu

  • gui

  • gur

  • guz

  • gv

  • gwc

  • gwe

  • gwt

  • gya

  • gyz

  • ha

  • hah

  • hao

  • haw

  • haz

  • hbb

  • he

  • hem

  • hi

  • hia

  • hkk

  • hla

  • hno

  • hoj

  • hr

  • hsb

  • ht

  • hu

  • hue

  • hul

  • hux

  • hwo

  • hy

  • hz

  • ia

  • ibb

  • id

  • ida

  • idu

  • ig

  • ijc

  • ijn

  • ik

  • ikw

  • is

  • ish

  • iso

  • it

  • its

  • itw

  • itz

  • ja

  • jal

  • jax

  • jgo

  • jmx

  • jns

  • jqr

  • juk

  • juo

  • jv

  • ka

  • kab

  • kai

  • kaj

  • kam

  • kbd

  • kbl

  • kbt

  • kcq

  • kdh

  • kea

  • keu

  • kfe

  • kfk

  • kfp

  • khg

  • khw

  • kj

  • kjc

  • kjk

  • kk

  • kln

  • kls

  • km

  • kmr

  • kmy

  • kn

  • kna

  • knn

  • ko

  • kol

  • koo

  • kpo

  • kqo

  • ks

  • ksd

  • ksf

  • kto

  • kuh

  • kvx

  • kw

  • kwm

  • kxp

  • ky

  • kyx

  • lag

  • lb

  • lcm

  • ldb

  • lg

  • lij

  • lir

  • lkb

  • lla

  • ln

  • lnu

  • lo

  • loa

  • lrk

  • lss

  • lt

  • ltg

  • lto

  • lua

  • luo

  • lus

  • lv

  • lwg

  • mab

  • maf

  • mai

  • mau

  • max

  • mbo

  • mcf

  • mcn

  • mcx

  • mdd

  • mde

  • mdf

  • mek

  • mer

  • meu

  • mfm

  • mfn

  • mfo

  • mfv

  • mgg

  • mgi

  • mhk

  • mhr

  • mi

  • mig

  • miu

  • mk

  • mkf

  • mki

  • ml

  • mlq

  • mn

  • mne

  • mni

  • mqy

  • mr

  • mrj

  • mrr

  • mrt

  • ms

  • mse

  • msh

  • msw

  • mt

  • mtr

  • mtu

  • mtx

  • mua

  • mug

  • mui

  • mve

  • mvy

  • mxs

  • mxu

  • mxy

  • my

  • myv

  • mzl

  • nal

  • nan

  • nap

  • nb

  • nbh

  • ncf

  • nco

  • ncx

  • ndi

  • ng

  • ngi

  • nhg

  • nhi

  • nhn

  • nhq

  • nja

  • nl

  • nla

  • nlv

  • nmg

  • nmz

  • nn

  • nnh

  • 'no'

  • noe

  • npi

  • nso

  • ny

  • nyu

  • oc

  • odk

  • odu

  • ogo

  • om

  • orc

  • oru

  • ory

  • os

  • pa

  • pbs

  • pbt

  • pbu

  • pcm

  • pex

  • phl

  • phr

  • pip

  • piy

  • pko

  • pl

  • plk

  • plt

  • pmq

  • pms

  • pmy

  • pnb

  • poc

  • poe

  • pow

  • prq

  • ps

  • pst

  • pt

  • pua

  • pwn

  • qug

  • qum

  • qup

  • qur

  • qus

  • quv

  • qux

  • quy

  • qva

  • qvi

  • qvj

  • qvl

  • qwa

  • qws

  • qxa

  • qxp

  • qxt

  • qxu

  • qxw

  • rag

  • rm

  • ro

  • rob

  • rof

  • roo

  • rth

  • ru

  • rup

  • rw

  • sa

  • sah

  • sat

  • sau

  • say

  • sbn

  • sc

  • scl

  • scn

  • sd

  • sei

  • shu

  • si

  • sip

  • siw

  • sjr

  • sk

  • skg

  • skr

  • sl

  • sn

  • snc

  • snk

  • so

  • sol

  • sps

  • sq

  • sr

  • src

  • sro

  • ssi

  • ste

  • sua

  • sv

  • sva

  • sw

  • szy

  • ta

  • tan

  • tar

  • tay

  • tbf

  • tcf

  • tcy

  • tdn

  • tdx

  • te

  • tg

  • tgc

  • th

  • the

  • thq

  • thr

  • thv

  • ti

  • tig

  • tio

  • tk

  • tkg

  • tkt

  • tli

  • tlp

  • tn

  • tok

  • tpl

  • tpz

  • tqp

  • tr

  • trp

  • trq

  • trv

  • trw

  • tt

  • ttj

  • ttr

  • ttu

  • tui

  • tul

  • tuq

  • tuv

  • tuy

  • tvo

  • tvu

  • tw

  • twu

  • txs

  • txy

  • udl

  • ug

  • uk

  • uki

  • umb

  • ur

  • ush

  • uz

  • uzn

  • vai

  • var

  • ver

  • vi

  • vmc

  • vmj

  • vmm

  • vmp

  • vmz

  • vot

  • vro

  • wbl

  • wci

  • weo

  • wes

  • wja

  • wji

  • wo

  • wof

  • xh

  • xhe

  • xka

  • xmf

  • xmv

  • xmw

  • xpe

  • xti

  • xtu

  • yaq

  • yav

  • yay

  • ydd

  • ydg

  • yer

  • 'yes'

  • yi

  • yo

  • yue

  • zga

  • zgh

  • zh

  • zoc

  • zoh

  • zor

  • zpv

  • zpy

  • ztg

  • ztn

  • ztp

  • zts

  • ztu

  • zu

  • zza

pipeline_tag: text-to-speech
tags:
  • zero-shot

  • multilingual

  • voice-cloning

  • voice-design

library_name: omnivoice
---

OmniVoice 🌍

<p align="center">
<img width="200" height="200" alt="OmniVoice" src="https://zhu-han.github.io/omnivoice/pics/omnivoice.jpg" />
</p>

<p align="center">
<a href="https://huggingface.co/k2-fsa/OmniVoice"><img src="https://img.shields.io/badge/%F0%9F%A4%97%20Hugging%20Face-Model-FFD21E" alt="Hugging Face Model"></a>
&nbsp;
<a href="https://huggingface.co/spaces/k2-fsa/OmniVoice"><img src="https://img.shields.io/badge/%F0%9F%A4%97%20Hugging%20Face-Space-blue" alt="Hugging Face Space"></a>
&nbsp;
<a href="https://huggingface.co/papers/2604.00688"><img src="https://img.shields.io/badge/arXiv-Paper-B31B1B.svg"></a>
&nbsp;
<a href="https://github.com/k2-fsa/OmniVoice"><img src="https://img.shields.io/badge/GitHub-Code-181717?logo=GitHub" alt="GitHub Code"></a>
&nbsp;
<a href="https://zhu-han.github.io/omnivoice"><img src="https://img.shields.io/badge/GitHub.io-Demo_Page-blue?logo=GitHub&style=flat-square"></a>
&nbsp;
<a href="https://colab.research.google.com/github/k2-fsa/OmniVoice/blob/master/docs/OmniVoice.ipynb"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"></a>
</p>

OmniVoice is a massively multilingual zero-shot text-to-speech (TTS) model supporting over 600 languages. Built on a novel diffusion language model-style architecture, it delivers high-quality speech with superior inference speed, supporting voice cloning and voice design.

Key Features

  • 600+ Languages Supported: The broadest language coverage among zero-shot TTS models.
  • Voice Cloning: State-of-the-art voice cloning quality from a short reference audio.
  • Voice Design: Control voices via assigned speaker attributes (gender, age, pitch, dialect/accent, whisper, etc.).
  • Fine-grained Control: Non-verbal symbols (e.g., [laughter]) and pronunciation correction via pinyin or phonemes.
  • Fast Inference: RTF as low as 0.025 (40x faster than real-time).
  • Diffusion Language Model-style Architecture: A clean, streamlined, and scalable design that delivers both quality and speed.

Usage

To get started, install the omnivoice library:

> We recommend using a fresh virtual environment (e.g., conda, venv, etc.) to avoid conflicts.

Step 1: Install PyTorch

<details>
<summary>NVIDIA GPU</summary>

bash
# Install pytorch with your CUDA version, e.g.
pip install torch==2.8.0+cu128 torchaudio==2.8.0+cu128 --extra-index-url https://download.pytorch.org/whl/cu128
> See PyTorch official site for other versions installation.

</details>

<details>
<summary>Apple Silicon</summary>

bash
pip install torch==2.8.0 torchaudio==2.8.0

</details>

Step 2: Install OmniVoice

bash
pip install omnivoice

Python API

You can use OmniVoice for zero-shot voice cloning as follows:

python
from omnivoice import OmniVoice
import soundfile as sf
import torch

Load the model

model = OmniVoice.from_pretrained( "k2-fsa/OmniVoice", device_map="cuda:0", dtype=torch.float16 )

Generate audio

audio = model.generate( text="Hello, this is a test of zero-shot voice cloning.", ref_audio="ref.wav", ref_text="Transcription of the reference audio.", ) # audio is a list of np.ndarray with shape (T,) at 24 kHz.

sf.write("out.wav", audio[0], 24000)

For more generation modes (e.g., voice design), functions (e.g., non-verbal symbols, pronunciation correction) and comprehensive usage instructions, see our GitHub Repository.

Discussion & Communication

You can directly discuss on [GitHub Issues](https://github