モデル概要
モデル特徴
モデル能力
使用事例
🚀 Typhoon2-Audio
Typhoon2-Audio は、オーディオ、音声、テキスト入力を処理し、テキストと音声出力を同時に生成できるエンドツーエンドの音声対音声モデルアーキテクチャです。特にタイ語用に最適化されていますが、英語もサポートしています。

- GitHub: https://github.com/scb-10x/typhoon2-audio/
- デモ: https://audio.opentyphoon.ai/
- 論文: https://arxiv.org/abs/2412.13702
🚀 クイックスタート
Typhoon2-Audio は、音声やテキストの入力を受け取り、テキストと音声の出力を同時に生成することができます。以下のセクションでは、モデルのインストール方法や使用例を紹介します。
✨ 主な機能
- オーディオ、音声、テキスト入力を処理し、テキストと音声出力を同時に生成する能力。
- タイ語に最適化されており、英語もサポート。
📦 インストール
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"])
TTS機能
y = model.synthesize_speech("Hello, my name is ไต้ฝุ่น I am a language model specialized in Thai")
# y => numpy array
📚 ドキュメント
モデルの説明
属性 | 詳情 |
---|---|
モデルタイプ | LLMはTyphoon2 LLMに基づいています。 |
要件 | Python==3.10 & transformers==4.52.2 & fairseq==0.12.2 & flash-attn |
主要言語 | タイ語 🇹🇭 と英語 🇬🇧 |
ライセンス - 音声入力 & LLM | Llama 3.1 Community License |
ライセンス - 音声出力 | CC-BY-NC |
評価結果
1) 音声と音声理解
モデル | ASR-en (WER↓) | ASR-th (WER↓) | En2Th (BLEU↑) | X2Th (BLEU↑) | Th2En (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 |
モデル | Gender-th (Acc) | SpokenQA-th (F1) | SpeechInstruct-(en,th) |
---|---|---|---|
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) コンテンツ生成
モデル | SpeechIF(En)-Quality | SpeechIF(En)-Style | SpeechIF(Th)-Quality | SpeechIF(Th)-Style |
---|---|---|---|---|
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) 音声品質
モデル | SpeechIF(En)-CER | SpeechIF(En)-UTMOS | SpeechIF(Th)-CER | SpeechIF(Th)-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が高くなっています。
🔧 技術詳細
このモデルは実験的なものであり、必ずしも人間の指示に正確に従うとは限らず、幻覚的な出力を生成する可能性があります。また、モデルにはモデレーション機構がないため、有害または不適切な応答を生成する可能性があります。開発者は、特定のアプリケーションに基づいて潜在的なリスクを慎重に評価する必要があります。
📄 ライセンス
このモデルは、音声入力とLLMに関しては Llama 3.1 Community License を、音声出力に関しては CC-BY-NC を使用しています。
フォローとサポート
- https://twitter.com/opentyphoon
- https://discord.gg/us5gAYmrxw
謝辞
SALMONNチームとLlama-Omniチームがコードとデータをオープンソース化してくれたこと、またマヒドール大学のBiomedical and Data Labが微調整された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},
}











