Llama3.1 Typhoon2 Audio 8b Instruct
台风2-音频版是一个端到端的语音转语音模型架构,能够处理音频、语音和文本输入,并同时生成文本和语音输出。该模型专门针对泰语优化,同时也支持英语。
下载量 664
发布时间 : 12/13/2024
模型简介
基于台风2大语言模型的语音转语音模型,支持泰语和英语的语音输入与输出,具备文本生成和语音合成能力。
模型特点
多模态输入输出
支持音频、语音和文本输入,并能同时生成文本和语音输出
泰语优化
专门针对泰语进行优化,提供高质量的泰语语音处理能力
端到端架构
完整的语音转语音处理流程,无需额外中间处理步骤
多轮对话支持
支持复杂的多轮对话交互,保持上下文一致性
模型能力
语音识别
语音合成
文本生成
语音转语音
多语言处理
对话系统
使用案例
语音助手
泰语语音助手
构建泰语语音助手,支持语音输入和语音输出
在泰语语音质量评估中获得7.19分(满分10分)
语音转录
泰语语音转录
将泰语语音内容转录为文本
泰语ASR的WER为14.04%
语音翻译
英泰语音翻译
将英语语音翻译为泰语文本或语音
英译泰BLEU得分为27.15
🚀 Typhoon2-Audio
Typhoon2-Audio 是一个端到端的语音到语音模型架构,能够处理音频、语音和文本输入,并同时生成文本和语音输出。它专门针对泰语进行了优化,但也支持英语。
- GitHub:https://github.com/scb-10x/typhoon2-audio/
- 演示:https://audio.opentyphoon.ai/
- 论文:https://arxiv.org/abs/2412.13702

✨ 主要特性
- 端到端的语音到语音处理能力,支持音频、语音和文本输入,可同时生成文本和语音输出。
- 专门针对泰语优化,同时支持英语。
📦 安装指南
pip install pip==24.0
pip install transformers==4.45.2
pip install fairseq==0.12.2 # fairseq required pip==24.0 to install & only worked only on python 3.10
pip install flash-attn
💻 使用示例
基础用法
加载模型
import torch
from transformers import AutoModel
model = AutoModel.from_pretrained(
"scb10x/llama3.1-typhoon2-audio-8b-instruct",
torch_dtype=torch.float16,
trust_remote_code=True
)
model.to("cuda")
单轮推理示例
conversation = [
{"role": "system", "content": "You are a helpful female assistant named ไต้ฝุ่น."},
{
"role": "user",
"content": [
{
"type": "audio",
"audio_url": "examples/tmp-2860cd0a094b64043226167340af03a3.wav",
},
{"type": "text", "text": "Transcribe this audio"},
],
},
]
x = model.generate(
conversation=conversation,
max_new_tokens=500,
do_sample=True,
num_beams=1,
top_p=0.9,
repetition_penalty=1.0,
length_penalty=1.0,
temperature=0.7,
)
# x => x['text'] (text), x['audio'] (numpy array)
# to save the audio output
# import soundfile as sf
# sf.write("examples/speechout.wav", x["audio"]["array"], x["audio"]["sampling_rate"])
高级用法
多轮推理示例
conversation_multi_turn = [
{
"role": "system",
"content": "You are a helpful female assistant named ไต้ฝุ่น. Respond conversationally to the speech provided in the language it is spoken in.",
},
{
"role": "user",
"content": [
{
"type": "audio",
"audio_url": "examples/tmp-2860cd0a094b64043226167340af03a3.wav",
# บอกชื่อเมืองใหญ่ๆในอเมริกามาให้หน่อยสิ -- "List some names of US cities"
},
{
"type": "text",
"text": "",
},
],
},
{
"role": "assistant",
"content": [
{
"type": "text",
"text": "โอเคค่ะ, ฉันจะบอกชื่อเมืองใหญ่ๆ ในอเมริกาให้คุณฟัง:\n\n1. นิวยอร์ก\n2. ลอสแอนเจลิส\n3. ชิคาโก\n4. ฮิวสตัน\n5. ฟิลาเดลเฟีย\n6. บอสตัน\n7. ซานฟรานซิสโก\n8. วอชิงตัน ดี.ซี. (Washington D.C.)\n9. แอตแลนต้า\n10. ซีแอตเทิล\n\nถ้าคุณต้องการข้อมูลเพิ่มเติมหรือมีคำถามอื่นๆ กรุณาถามได้เลยค่ะ'",
},
],
},
{
"role": "user",
"content": [
{
"type": "audio",
"audio_url": "examples/tmp-2284cd76e1c875525ff75327a2fc3610.wav",
# แล้วถ้าเป็นประเทศอังกฤษล่ะ -- "How about the UK"
},
],
},
]
x = model.generate(conversation=conversation_multi_turn)
# x => x['text'] (text), x['audio'] (numpy array)
# to save the audio output
# import soundfile as sf
# sf.write("examples/speechout.wav", x["audio"]["array"], x["audio"]["sampling_rate"])
文本转语音功能
y = model.synthesize_speech("Hello, my name is ไต้ฝุ่น I am a language model specialized in Thai")
# y => numpy array
📚 详细文档
模型描述
属性 | 详情 |
---|---|
模型类型 | 该大语言模型基于 Typhoon2 LLM。 |
依赖库 | Python==3.10 & transformers==4.52.2 & fairseq==0.12.2 & flash-attn |
主要语言 | 泰语 🇹🇭 和英语 🇬🇧 |
语音输入与大语言模型许可证 | Llama 3.1 Community License |
语音输出许可证 | CC-BY-NC |
评估结果
1) 音频和语音理解
模型 | 英文自动语音识别 (WER↓) | 泰文自动语音识别 (WER↓) | 英文转泰文 (BLEU↑) | 多语言转泰文 (BLEU↑) | 泰文转英文 (BLEU↑) |
---|---|---|---|---|---|
SALMONN - 13B | 5.79 | 98.07 | 0.07 | 0.10 | 14.97 |
DiVA - 8B | 30.28 | 65.21 | 9.82 | 5.31 | 7.97 |
Gemini - 1.5 - pro - 001 | 5.98 | 13.56 | 20.69 | 13.52 | 22.54 |
Typhoon - Audio | 8.72 | 14.17 | 17.52 | 10.67 | 24.14 |
Typhoon2 - Audio | 5.83 | 14.04 | 27.15 | 15.93 | 33.25 |
模型 | 泰语性别识别 (Acc) | 泰语口语问答 (F1) | 语音指令 (英语, 泰语) |
---|---|---|---|
SALMONN - 13B | 93.26 | 2.95 | 2.47, 1.18 |
DiVA - 8B | 50.12 | 15.13 | 6.81, 2.68 |
Gemini - 1.5 - pro - 001 | 81.32 | 62.10 | 3.24, 3.93 |
Typhoon - Audio | 93.74 | 64.60 | 5.62, 6.11 |
Typhoon2 - Audio | 75.65 | 70.01 | 6.00, 6.79 |
2) 语音到语音评估
2.1) 内容生成
模型 | 英文语音信息框架 - 质量 | 英文语音信息框架 - 风格 | 泰文语音信息框架 - 质量 | 泰文语音信息框架 - 风格 |
---|---|---|---|---|
Llama - Omni | 5.15 | 5.79 | 1.71 | 2.14 |
GPT - 4o - Audio | 6.82 | 7.86 | 6.66 | 8.07 |
Typhoon2 - Audio | 4.92 | 5.39 | 7.19 | 8.04 |
2.2) 语音质量
模型 | 英文语音信息框架 - CER | 英文语音信息框架 - UTMOS | 泰文语音信息框架 - CER | 泰文语音信息框架 - UTMOS |
---|---|---|---|---|
Llama - Omni* | 3.40 | 3.93 | 6.30 | 3.93 |
GPT - 4o - Audio | 3.20 | 3.65 | 8.05 | 3.46 |
Typhoon2 - Audio | 26.50 | 2.29 | 8.67 | 2.35 |
*注意,Llama - Omni 不生成泰语文本/语音,因此由于输出为英语,其 CER 较低且 UTMOS 较高。
预期用途与限制
⚠️ 重要提示
该模型处于实验阶段,可能并不总是能准确遵循人类指令,容易产生幻觉内容。此外,该模型缺乏审核机制,可能会产生有害或不适当的回复。开发者应根据具体应用仔细评估潜在风险。
关注与支持
- https://twitter.com/opentyphoon
- https://discord.gg/us5gAYmrxw
致谢
我们要感谢 SALMONN 团队和 Llama - Omni 团队开源他们的代码和数据,感谢玛希隆大学的生物医学与数据实验室发布的微调版 Whisper,使我们能够采用其编码器。同时感谢许多其他开源项目分享有用的知识、数据、代码和模型权重。
Typhoon 团队
Potsawee Manakul, Warit Sirichotedumrong, Kunat Pipatanakul, Pittawat Taveekitworachai, Natapong Nitarach, Surapon Nonesung, Teetouch Jaknamon, Parinthapat Pengpun, Pittawat Taveekitworachai, Adisai Na - Thalang, Sittipong Sripaisarnmongkol, Krisanapong Jirayoot, Kasima Tharnpipitchai
引用
如果您发现 Typhoon2 对您的工作有帮助,请使用以下方式引用:
@misc{typhoon2,
title={Typhoon 2: A Family of Open Text and Multimodal Thai Large Language Models},
author={Kunat Pipatanakul and Potsawee Manakul and Natapong Nitarach and Warit Sirichotedumrong and Surapon Nonesung and Teetouch Jaknamon and Parinthapat Pengpun and Pittawat Taveekitworachai and Adisai Na-Thalang and Sittipong Sripaisarnmongkol and Krisanapong Jirayoot and Kasima Tharnpipitchai},
year={2024},
eprint={2412.13702},
archivePrefix={arXiv},
primaryClass={cs.CL},
url={https://arxiv.org/abs/2412.13702},
}
📄 许可证
该模型的语音输入与大语言模型遵循 Llama 3.1 Community License,语音输出遵循 CC-BY-NC。
Phi 4 Multimodal Instruct
MIT
Phi-4-multimodal-instruct是一款轻量级开源多模态基础模型,融合了Phi-3.5和4.0模型的语言、视觉及语音研究数据。支持文本、图像和音频输入,生成文本输出,并具备128K token的上下文长度。
文本生成音频
Transformers 支持多种语言

P
microsoft
584.02k
1,329
Ultravox V0 5 Llama 3 2 1b
MIT
Ultravox是一个基于Llama3.2-1B和Whisper-large-v3构建的多模态语音大语言模型,能够同时处理语音和文本输入。
文本生成音频
Transformers 支持多种语言

U
fixie-ai
167.25k
21
Seamless M4t V2 Large
SeamlessM4T v2 是 Facebook 发布的大规模多语言多模态机器翻译模型,支持近100种语言的语音和文本翻译。
文本生成音频
Transformers 支持多种语言

S
facebook
64.59k
821
Ultravox V0 3
MIT
Ultravox 是一个基于 Llama3.1-8B-Instruct 和 Whisper-small 构建的多模态语音大语言模型,能够同时处理语音和文本输入。
文本生成音频
Transformers 英语

U
fixie-ai
48.30k
17
Ultravox V0 5 Llama 3 1 8b
MIT
Ultravox是一款基于Llama3.1-8B-Instruct和whisper-large-v3-turbo构建的多模态语音大语言模型,能够同时处理语音和文本输入。
文本生成音频
Transformers 支持多种语言

U
fixie-ai
17.86k
12
Hf Seamless M4t Medium
SeamlessM4T 是一个多语言翻译模型,支持语音和文本的输入输出,实现跨语言交流。
文本生成音频
Transformers

H
facebook
14.74k
30
Granite Speech 3.3 8b
Apache-2.0
专为自动语音识别(ASR)和自动语音翻译(AST)设计的紧凑高效语音语言模型,采用双阶段设计处理音频和文本
文本生成音频
Transformers 英语

G
ibm-granite
5,532
35
Voila Tokenizer
MIT
Voila是一个大型语音-语言基础模型系列,旨在提升人机交互体验,支持多种音频任务和语言。
文本生成音频
Transformers 支持多种语言

V
maitrix-org
4,912
3
Hf Seamless M4t Large
SeamlessM4T 是一个支持多语言语音和文本翻译的统一模型,能够实现语音到语音、语音到文本、文本到语音和文本到文本的翻译任务。
文本生成音频
Transformers

H
facebook
4,648
57
Minicpm O 2 6 Int4
MiniCPM-o 2.6的int4量化版本,显著降低GPU显存占用,支持多模态处理能力。
文本生成音频
Transformers 其他

M
openbmb
4,249
42
精选推荐AI模型
Llama 3 Typhoon V1.5x 8b Instruct
专为泰语设计的80亿参数指令模型,性能媲美GPT-3.5-turbo,优化了应用场景、检索增强生成、受限生成和推理任务
大型语言模型
Transformers 支持多种语言

L
scb10x
3,269
16
Cadet Tiny
Openrail
Cadet-Tiny是一个基于SODA数据集训练的超小型对话模型,专为边缘设备推理设计,体积仅为Cosmo-3B模型的2%左右。
对话系统
Transformers 英语

C
ToddGoldfarb
2,691
6
Roberta Base Chinese Extractive Qa
基于RoBERTa架构的中文抽取式问答模型,适用于从给定文本中提取答案的任务。
问答系统 中文
R
uer
2,694
98