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.
- Libraries
- llama-cpp-python
How to use Luigi/PrimeTTS with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="Luigi/PrimeTTS", filename="streaming_llm/gemma270m_it_q8.gguf", )
llm.create_chat_completion( messages = "\"The answer to the universe is 42\"" )
- 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
| #!/usr/bin/env python3 | |
| """RANK-1 acoustic probe: synth N training clips with FORCED (ground-truth) durations through an | |
| ONNX dir, isolating the phones->mel mapping from the duration predictor + g2p frontend. | |
| Reads phone/tone/lang ids + GT durations directly from m2_align.jsonl (no frontend). | |
| Run in moss-train-venv. Then ASR the wavs (probe_forced_asr via xasr_offline) -> CER. | |
| Pairs the 0.80(forced)-vs-0.145(GT-mel) acoustic gap to a single number per config.""" | |
| import argparse, json, sys | |
| from pathlib import Path | |
| import numpy as np, soundfile as sf, onnxruntime as ort | |
| ZT = "/home/luigi/jetson-tts/mossnano/zhtw8k" | |
| sys.path.insert(0, ZT) | |
| from synth_from_text import host_regulate | |
| def main(): | |
| ap = argparse.ArgumentParser() | |
| ap.add_argument("--onnx-dir", required=True) | |
| ap.add_argument("--out-dir", required=True) | |
| ap.add_argument("--n", type=int, default=30) | |
| ap.add_argument("--align-jsonl", default=f"{ZT}/m2_align.jsonl") | |
| args = ap.parse_args() | |
| meta = json.load(open(f"{args.onnx_dir}/meta.json")) | |
| so = ort.SessionOptions(); so.intra_op_num_threads = 4 | |
| sA = ort.InferenceSession(f"{args.onnx_dir}/acoustic_encoder.onnx", so, providers=["CPUExecutionProvider"]) | |
| sB = ort.InferenceSession(f"{args.onnx_dir}/acoustic_decoder.onnx", so, providers=["CPUExecutionProvider"]) | |
| sV = ort.InferenceSession(f"{args.onnx_dir}/vocoder.onnx", so, providers=["CPUExecutionProvider"]) | |
| bn = ["frames", "frame_meta", "local_ctx_raw", "abs_pos", "pitch_frame", "frame_mask"] | |
| Path(args.out_dir).mkdir(parents=True, exist_ok=True) | |
| rows = [json.loads(l) for l in open(args.align_jsonl) if l.strip()][:args.n] | |
| out = open(f"{args.out_dir}/synth.jsonl", "w") | |
| for i, r in enumerate(rows): | |
| phone = np.array([r["phone_ids"]], np.int64); tone = np.array([r["tone_ids"]], np.int64) | |
| lang = np.array([r["lang_ids"]], np.int64); spk = np.zeros(1, np.int64) | |
| cond, _dur_pred, pitch = sA.run(None, {"phone": phone, "tone": tone, "lang": lang, "speaker": spk}) | |
| # substitute GT (forced) durations, rescaled so total ~ predicted length (stable regulator) | |
| df = np.array([r["hifigan_durations"]], np.float32) | |
| df = df * (_dur_pred.sum() / max(1.0, df.sum())) | |
| reg = host_regulate(cond, df, pitch, meta["abs_frame_bins"], meta["max_frames"]) | |
| feeds = {n: (reg[n].astype(np.float32) if reg[n].dtype != bool else reg[n]) for n in bn} | |
| feeds["abs_pos"] = reg["abs_pos"].astype(np.int64) | |
| mel = sB.run(None, feeds)[0] | |
| wav = sV.run(None, {"mel": mel.astype(np.float32)})[0].reshape(-1) | |
| wp = f"{args.out_dir}/p{i:03d}.wav"; sf.write(wp, wav, meta["sample_rate"]) | |
| out.write(json.dumps({"id": f"p{i:03d}", "text": r["text"], "wav": wp}, ensure_ascii=False) + "\n") | |
| out.close() | |
| print(f"PROBE SYNTH DONE {len(rows)} clips -> {args.out_dir}/synth.jsonl") | |
| if __name__ == "__main__": | |
| main() | |