Text-to-Speech
ONNX
GGUF
Chinese
English
onnxruntime
tts
on-device
jetson
telephony
vits
mb-istft-vits
multi-speaker
mandarin
taiwanese-mandarin
imatrix
conversational
Instructions to use Luigi/PrimeTTS with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use Luigi/PrimeTTS with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf Luigi/PrimeTTS:F32 # Run inference directly in the terminal: llama cli -hf Luigi/PrimeTTS:F32
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf Luigi/PrimeTTS:F32 # Run inference directly in the terminal: llama cli -hf Luigi/PrimeTTS:F32
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf Luigi/PrimeTTS:F32 # Run inference directly in the terminal: ./llama-cli -hf Luigi/PrimeTTS:F32
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf Luigi/PrimeTTS:F32 # Run inference directly in the terminal: ./build/bin/llama-cli -hf Luigi/PrimeTTS:F32
Use Docker
docker model run hf.co/Luigi/PrimeTTS:F32
- LM Studio
- Jan
- Ollama
How to use Luigi/PrimeTTS with Ollama:
ollama run hf.co/Luigi/PrimeTTS:F32
- Unsloth Studio
How to use Luigi/PrimeTTS with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for Luigi/PrimeTTS to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for Luigi/PrimeTTS to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for Luigi/PrimeTTS to start chatting
- Atomic Chat new
- Docker Model Runner
How to use Luigi/PrimeTTS with Docker Model Runner:
docker model run hf.co/Luigi/PrimeTTS:F32
- Lemonade
How to use Luigi/PrimeTTS with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull Luigi/PrimeTTS:F32
Run and chat with the model
lemonade run user.PrimeTTS-F32
List all available models
lemonade list
reproduction: actual VoxCPM2-TW pipeline scripts + master run + eval set
Browse files- scripts/asr_filter.py +71 -0
scripts/asr_filter.py
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/usr/bin/env python3
|
| 2 |
+
"""ASR quality-gate the VoxCPM2 teacher corpus before alignment/training.
|
| 3 |
+
zh + mix -> Han-only CER via Breeze-ASR-25 (zh-TW); en -> WER via generic whisper.
|
| 4 |
+
(mix uses Han-only CER, so embedded English is ignored — we only verify the Chinese portion.)
|
| 5 |
+
Drops clips above threshold. Writes <out>.clean.jsonl (kept) + <out>.rejected.jsonl (with scores).
|
| 6 |
+
Run in moss-nano-venv (faster_whisper, opencc). GPU recommended.
|
| 7 |
+
CUDA_VISIBLE_DEVICES=0 python asr_filter.py --manifest voxcpm_tw_manifest.jsonl --out voxcpm_tw_manifest
|
| 8 |
+
"""
|
| 9 |
+
import argparse, json, re, sys
|
| 10 |
+
import numpy as np, soundfile as sf
|
| 11 |
+
import opencc
|
| 12 |
+
_t2s = opencc.OpenCC("t2s")
|
| 13 |
+
def _han(s): return re.sub(r"[^一-鿿]", "", s)
|
| 14 |
+
def _norm_zh(s): return _han(_t2s.convert(s or ""))
|
| 15 |
+
def _norm_en(s): return re.sub(r"[^a-z' ]", " ", (s or "").lower()).split()
|
| 16 |
+
def _lev(a, b):
|
| 17 |
+
m, n = len(a), len(b)
|
| 18 |
+
if m == 0: return n
|
| 19 |
+
prev = list(range(n + 1))
|
| 20 |
+
for i in range(1, m + 1):
|
| 21 |
+
cur = [i] + [0] * n
|
| 22 |
+
for j in range(1, n + 1):
|
| 23 |
+
cur[j] = min(prev[j] + 1, cur[j-1] + 1, prev[j-1] + (a[i-1] != b[j-1]))
|
| 24 |
+
prev = cur
|
| 25 |
+
return prev[n]
|
| 26 |
+
def _cer(ref, hyp): r = _norm_zh(ref); return _lev(list(r), list(_norm_zh(hyp))) / max(1, len(r))
|
| 27 |
+
def _wer(ref, hyp): r = _norm_en(ref); return _lev(r, _norm_en(hyp)) / max(1, len(r))
|
| 28 |
+
|
| 29 |
+
def main():
|
| 30 |
+
ap = argparse.ArgumentParser()
|
| 31 |
+
ap.add_argument("--manifest", required=True)
|
| 32 |
+
ap.add_argument("--out", required=True, help="prefix -> <out>.clean.jsonl / <out>.rejected.jsonl")
|
| 33 |
+
ap.add_argument("--device", default="cuda")
|
| 34 |
+
ap.add_argument("--compute-type", default="float16")
|
| 35 |
+
ap.add_argument("--cer-zh", type=float, default=0.12)
|
| 36 |
+
ap.add_argument("--cer-mix", type=float, default=0.15)
|
| 37 |
+
ap.add_argument("--wer-en", type=float, default=0.20)
|
| 38 |
+
a = ap.parse_args()
|
| 39 |
+
from faster_whisper import WhisperModel
|
| 40 |
+
breeze = WhisperModel("SoybeanMilk/faster-whisper-Breeze-ASR-25", device=a.device, compute_type=a.compute_type)
|
| 41 |
+
generic = WhisperModel("medium", device=a.device, compute_type=a.compute_type)
|
| 42 |
+
def asr(model, wav, lang):
|
| 43 |
+
segs, _ = model.transcribe(wav, language=lang, beam_size=1)
|
| 44 |
+
return "".join(s.text for s in segs)
|
| 45 |
+
rows = [json.loads(l) for l in open(a.manifest) if l.strip()]
|
| 46 |
+
kept = open(f"{a.out}.clean.jsonl", "w", encoding="utf-8")
|
| 47 |
+
rej = open(f"{a.out}.rejected.jsonl", "w", encoding="utf-8")
|
| 48 |
+
nk = nr = 0; n = 0
|
| 49 |
+
for r in rows:
|
| 50 |
+
wav, ref, lang = r["target_audio"], r["text"], r["lang"]
|
| 51 |
+
try:
|
| 52 |
+
if lang == "en":
|
| 53 |
+
score = _wer(ref, asr(generic, wav, "en")); thr = a.wer_en; metric = "wer"
|
| 54 |
+
else:
|
| 55 |
+
score = _cer(ref, asr(breeze, wav, "zh")); thr = (a.cer_mix if lang == "mix" else a.cer_zh); metric = "cer"
|
| 56 |
+
except Exception as e:
|
| 57 |
+
r["_err"] = str(e)[:80]; rej.write(json.dumps(r, ensure_ascii=False) + "\n"); nr += 1; continue
|
| 58 |
+
r[metric] = round(float(score), 3)
|
| 59 |
+
if score <= thr:
|
| 60 |
+
kept.write(json.dumps(r, ensure_ascii=False) + "\n"); nk += 1
|
| 61 |
+
else:
|
| 62 |
+
rej.write(json.dumps(r, ensure_ascii=False) + "\n"); nr += 1
|
| 63 |
+
n += 1
|
| 64 |
+
if n % 200 == 0:
|
| 65 |
+
kept.flush(); rej.flush()
|
| 66 |
+
print(f"{n}/{len(rows)} kept={nk} rej={nr} ({nr/n*100:.1f}% drop)", flush=True)
|
| 67 |
+
kept.close(); rej.close()
|
| 68 |
+
print(f"FILTER_DONE kept={nk} rejected={nr} drop={nr/max(1,nk+nr)*100:.1f}%", flush=True)
|
| 69 |
+
|
| 70 |
+
if __name__ == "__main__":
|
| 71 |
+
main()
|