Views
No views yet
SFTTrainer[!IMPORTANT] Compatibility Note Recent updates tooutettshave introduced breaking changes. If you encounter the error:AttributeError: module 'outetts' has no attribute 'GGUFModelConfig_v2'Solution: Please install a compatible version (0.3.3 or 0.3.2) to resolve this:pip install outetts==0.3.3
outetts as follows:outetts and llama-cpp-python:pip install outetts==0.3.3 llama-cpp-python huggingface_hub1import outetts
2from outetts.models.config import GenerationConfig
3from huggingface_hub import hf_hub_download
4
5model_path = hf_hub_download(
6 repo_id="KandirResearch/DarijaTTS-v0.1-500M",
7 filename="unsloth.Q8_0.gguf",
8)
9model_config = outetts.GGUFModelConfig_v2(
10 model_path=model_path,
11 tokenizer_path="KandirResearch/DarijaTTS-v0.1-500M",
12)
13interface = outetts.InterfaceGGUF(model_version="0.3", cfg=model_config)
14
15def tts(text, temperature=0.3, repetition_penalty=1.1):
16 gen_cfg = GenerationConfig(
17 text=text,
18 temperature=temperature,
19 repetition_penalty=repetition_penalty,
20 max_length=4096,
21 )
22 output = interface.generate(config=gen_cfg)
23 output_path = "output.wav"
24 output.save(output_path)
25 return output_path
26
27# Example usage
28audio_path = tts("السلام كيداير لاباس عليك؟")
29print(f"Generated audio saved at: {audio_path}")Unsloth's SFTTrainer. The dataset was preprocessed following the OuteTTS training guide. LoRA-based fine-tuning was applied to improve efficiency.