Views
No views yet
lora_tahm_kench_v2.2 subdir.csm_mlx. Tahm Kench is speaker 0.max_audio_length is too long, it can cause quality issues.1from mlx_lm.sample_utils import make_sampler
2from huggingface_hub import hf_hub_download
3from csm_mlx import CSM, csm_1b, generate
4import audiofile
5
6text = "I do not hold grudges. I marinade them."
7filename = "test.wav"
8
9weights = hf_hub_download(repo_id="xlr8harder/csm-1b-mlx-tahm-kench", filename="ckpt.safetensors")
10csm = CSM(csm_1b())
11csm.load_weights(weights)
12sampler = make_sampler(temp=0.3, top_k=10, top_p=0.9)
13audio = generate(
14 csm,
15 text=text,
16 speaker=0,
17 context=[],
18 sampler=sampler,
19)
20audiofile.write(filename, audio, 24000)
21print(f"Wrote to {filename}")