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
| """zh-TW/en unified frontend for the Inflect-Nano retrain. | |
| zh chars -> bopomofo (g2pw, Taiwan readings) -> zhuyin symbol units + tone (1-5); | |
| en words -> arpabet (g2p_en) + stress; one sequence, per-phone language id (ZH/EN). | |
| """ | |
| from __future__ import annotations | |
| import re | |
| from g2pw import G2PWConverter | |
| from g2p_en import G2p | |
| # 37 standard zhuyin symbols (U+3105..U+3129) | |
| ZHUYIN = [chr(c) for c in range(0x3105, 0x312A)] | |
| ARPABET = ['AA','AE','AH','AO','AW','AY','B','CH','D','DH','EH','ER','EY','F','G','HH', | |
| 'IH','IY','JH','K','L','M','N','NG','OW','OY','P','R','S','SH','T','TH', | |
| 'UH','UW','V','W','Y','Z','ZH'] | |
| PUNCT = [',', '.', '?', '!', 'β¦', '-', "'"] | |
| SPECIAL = ['_blank', '_pad', 'UNK', 'SP'] # SP = inter-word/space pause | |
| # γ = syllabic-vowel symbol for empty-rime syllables (ζ―/ε/ζ₯/εΈ...). U+312D is outside the | |
| # U+3105..U+3129 ZHUYIN range so it was missing. APPENDED AT END to preserve all existing phone ids | |
| # (warm-start compatibility); new id, embedding row trained during the re-align retrain. | |
| SYLLABIC = ['γ'] | |
| SYMBOLS = SPECIAL + ZHUYIN + ARPABET + PUNCT + SYLLABIC | |
| SYM2ID = {s: i for i, s in enumerate(SYMBOLS)} | |
| LANG = {'ZH': 0, 'EN': 1} # per-phone language id | |
| _g2pw = None | |
| _g2pen = None | |
| import text_norm # entity-aware normalizer (phone/email/price/date/β¦) | |
| def _lazy(): | |
| global _g2pw, _g2pen | |
| if _g2pw is None: | |
| _g2pw = G2PWConverter() | |
| _g2pen = G2p() | |
| def _split_syllable(syl: str): | |
| """'γγ¨γ’3' -> (['γ','γ¨','γ’'], tone 3).""" | |
| tone = 0 | |
| if syl and syl[-1].isdigit(): | |
| tone = int(syl[-1]); syl = syl[:-1] | |
| units = [c for c in syl if c in SYM2ID] | |
| # Empty-rime syllables (zhi/chi/shi/ri/zi/ci/si: ζ―/ε/ζ₯/εΈ/ζ/θ³...) are written in bopomofo as | |
| # the bare retroflex/dental sibilant with an IMPLICIT syllabic vowel. Without an explicit vowel | |
| # phone the model renders a clipped fricative that merges into the next syllable. Append the | |
| # syllabic-vowel symbol γ so these carry a proper rime. (Requires training data with γ.) | |
| if len(units) == 1 and units[0] in "γγγγγγγ" and "γ" in SYM2ID: | |
| units = [units[0], "γ"] | |
| return units, tone | |
| def text_to_phones(text: str): | |
| _lazy() | |
| text = text_norm.normalize(text) # entities -> spoken form, normalize punct | |
| bopo = _g2pw(text)[0] # per-char bopomofo or None | |
| chars = list(text) | |
| phones, tones, langs = [], [], [] | |
| i = 0 | |
| while i < len(chars): | |
| b = bopo[i] if i < len(bopo) else None | |
| ch = chars[i] | |
| if b is not None: # zh char | |
| units, tone = _split_syllable(b) | |
| for u in units: | |
| phones.append(u); tones.append(min(tone, 5)); langs.append(LANG['ZH']) | |
| i += 1 | |
| elif re.match(r'[A-Za-z]', ch): # English run -> g2p_en | |
| j = i | |
| while j < len(chars) and re.match(r"[A-Za-z']", chars[j]): | |
| j += 1 | |
| word = ''.join(chars[i:j]) | |
| for p in _g2pen(word): | |
| p = p.strip() | |
| if not p: | |
| continue | |
| stress = 0 | |
| if p[-1].isdigit(): | |
| stress = int(p[-1]); p = p[:-1] | |
| if p in SYM2ID: | |
| phones.append(p); tones.append(stress); langs.append(LANG['EN']) | |
| phones.append('SP'); tones.append(0); langs.append(LANG['EN']) | |
| i = j | |
| else: # punctuation / space / other | |
| if ch in PUNCT: | |
| phones.append(ch); tones.append(0); langs.append(LANG['ZH']) | |
| elif ch.strip() == '': | |
| if phones and phones[-1] != 'SP': | |
| phones.append('SP'); tones.append(0); langs.append(LANG['ZH']) | |
| i += 1 | |
| return phones, tones, langs | |
| def text_to_ids(text: str): | |
| phones, tones, langs = text_to_phones(text) | |
| ids = [SYM2ID.get(p, SYM2ID['UNK']) for p in phones] | |
| return {"phones": phones, "phone_ids": ids, "tone_ids": tones, "lang_ids": langs} | |