--- library_name: transformers tags: - unsloth - trl - sft - tts license: apache-2.0 language: - ary datasets: - KandirResearch/DarijaTTS-clean base_model: - OuteAI/OuteTTS-0.2-500M pipeline_tag: text-to-speech --- # Moroccan Darija TTS This is a text-to-speech (TTS) model for Moroccan Darija, fine-tuned from [OuteAI/OuteTTS-0.2-500M](https://huggingface.co/OuteAI/OuteTTS-0.2-500M) on the [KandirResearch/DarijaTTS-clean](https://huggingface.co/datasets/KandirResearch/DarijaTTS-clean) dataset. ## Model Details - **Base Model:** [OuteAI/OuteTTS-0.2-500M](https://huggingface.co/OuteAI/OuteTTS-0.2-500M) - **Dataset:** [KandirResearch/DarijaTTS-clean](https://huggingface.co/datasets/KandirResearch/DarijaTTS-clean) - **Training Method:** Fine-tuned using Unsloth's `SFTTrainer` - **Dataset Preparation:** Preprocessed following [OuteTTS training guide](https://github.com/edwko/OuteTTS/blob/main/examples/training/OuteTTS-0.3/train.md) - **Demo:** [Try it here](https://huggingface.co/spaces/Lyte/DarijaTTS-test) ## Usage You can run the model using `outetts` as follows: install `outetts` and `llama-cpp-python` ```bash pip install outetts llama-cpp-python huggingface_hub ``` ```python 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 # Example usage audio_path = tts("السلام كيداير لاباس عليك؟") print(f"Generated audio saved at: {audio_path}") ``` ## Training The model was fine-tuned using `Unsloth`'s `SFTTrainer`. The dataset was preprocessed following the [OuteTTS training guide](https://github.com/edwko/OuteTTS/blob/main/examples/training/OuteTTS-0.3/train.md). LoRA-based fine-tuning was applied to improve efficiency. # Support Me [![Buy Me A Coffee](https://img.shields.io/badge/Ko--fi-Support%20My%20Work-FF5E5B?style=for-the-badge&logo=ko-fi&logoColor=white)](https://ko-fi.com/lyte) --- For any issues or improvements, feel free to open a discussion or PR!