🚀 摩洛哥达里贾语文本转语音模型
这是一个用于摩洛哥达里贾语的文本转语音(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!