🚀 摩洛哥達裡賈語文本轉語音模型
這是一個用於摩洛哥達裡賈語的文本轉語音(TTS)模型,它基於 OuteAI/OuteTTS - 0.2 - 500M 模型,在 KandirResearch/DarijaTTS - clean 數據集上進行了微調。該模型能夠將摩洛哥達裡賈語的文本轉換為自然流暢的語音,為達裡賈語的語音應用提供了有力支持。
🚀 快速開始
安裝依賴
你可以按照以下步驟運行該模型,首先需要安裝 outetts
和 llama - cpp - python
:
pip install outetts llama-cpp-python huggingface_hub
運行模型
import outetts
from outetts.models.config import GenerationConfig
from huggingface_hub import hf_hub_download
model_path = hf_hub_download(
repo_id="KandirResearch/DarijaTTS-v0.1-500M",
filename="unsloth.Q8_0.gguf",
)
model_config = outetts.GGUFModelConfig_v2(
model_path=model_path,
tokenizer_path="KandirResearch/DarijaTTS-v0.1-500M",
)
interface = outetts.InterfaceGGUF(model_version="0.3", cfg=model_config)
def tts(text, temperature=0.3, repetition_penalty=1.1):
gen_cfg = GenerationConfig(
text=text,
temperature=temperature,
repetition_penalty=repetition_penalty,
max_length=4096,
)
output = interface.generate(config=gen_cfg)
output_path = "output.wav"
output.save(output_path)
return output_path
audio_path = tts("السلام كيداير لاباس عليك؟")
print(f"生成的音頻保存路徑: {audio_path}")
✨ 主要特性
- 針對性強:專門為摩洛哥達裡賈語設計,能更好地處理該語言的語音轉換。
- 微調優化:基於
Unsloth
的 SFTTrainer
進行微調,提升了模型性能。
- 高效訓練:採用 LoRA 基於的微調方法,提高了訓練效率。
📦 安裝指南
安裝 outetts
和 llama - cpp - python
以及 huggingface_hub
:
pip install outetts llama-cpp-python huggingface_hub
💻 使用示例
基礎用法
import outetts
from outetts.models.config import GenerationConfig
from huggingface_hub import hf_hub_download
model_path = hf_hub_download(
repo_id="KandirResearch/DarijaTTS-v0.1-500M",
filename="unsloth.Q8_0.gguf",
)
model_config = outetts.GGUFModelConfig_v2(
model_path=model_path,
tokenizer_path="KandirResearch/DarijaTTS-v0.1-500M",
)
interface = outetts.InterfaceGGUF(model_version="0.3", cfg=model_config)
def tts(text, temperature=0.3, repetition_penalty=1.1):
gen_cfg = GenerationConfig(
text=text,
temperature=temperature,
repetition_penalty=repetition_penalty,
max_length=4096,
)
output = interface.generate(config=gen_cfg)
output_path = "output.wav"
output.save(output_path)
return output_path
audio_path = tts("السلام كيداير لاباس عليك؟")
print(f"生成的音頻保存路徑: {audio_path}")
📚 詳細文檔
模型詳情
訓練信息
該模型使用 Unsloth
的 SFTTrainer
進行微調。數據集按照 OuteTTS 訓練指南 進行預處理,並應用了基於 LoRA 的微調方法以提高效率。
📄 許可證
本項目採用 apache - 2.0
許可證。
支持作者
如果你覺得這個項目有幫助,可以點擊下面的鏈接支持作者:

如果你在使用過程中遇到任何問題或有改進建議,歡迎發起討論或提交 PR!