Trelis / piper-zh-cn-huayan-medium

huggingface.co
Total runs: 379
24-hour runs: 0
7-day runs: 55
30-day runs: -108
Model's Last Updated: March 26 2026
text-to-speech

Introduction of piper-zh-cn-huayan-medium

Model Details of piper-zh-cn-huayan-medium

Piper TTS: zh_CN-huayan-medium

Medium-size Mandarin Chinese female voice.

Model Details
Field Value
Architecture VITS (end-to-end)
Format ONNX
Language Chinese (Mandarin)
Gender Female
Model Size medium (~63 MB ONNX, ~15M params)
Sample Rate 22050 Hz
License See source (HuaYan TTS)

Note: Piper uses the terms "medium", "high", etc. to refer to model size , not output quality. Medium models ( 63 MB, ~15M params) and high models ( 114 MB, ~28M params) both produce 22.05 kHz audio.

Usage
With piper-tts (GPL)
from piper import PiperVoice

voice = PiperVoice.load("model.onnx")
for chunk in voice.synthesize("Hello, this is a test."):
    # chunk.audio_float_array contains float32 audio
    pass
Standalone ONNX (MIT — no piper-tts dependency)

Requires espeak-ng installed ( brew install espeak-ng / apt install espeak-ng ).

import json, subprocess, numpy as np, onnxruntime as ort, soundfile as sf
from huggingface_hub import hf_hub_download

model_id = "Trelis/piper-zh-cn-huayan-medium"
onnx_path = hf_hub_download(model_id, "model.onnx")
config_path = hf_hub_download(model_id, "model.onnx.json")

with open(config_path) as f:
    config = json.load(f)

session = ort.InferenceSession(onnx_path, providers=["CPUExecutionProvider"])
phoneme_id_map = config["phoneme_id_map"]
espeak_voice = config["espeak"]["voice"]

def phonemize(text, voice):
    out = subprocess.run(
        ["espeak-ng", "-v", voice, "-q", "--ipa=2", "-x", text],
        capture_output=True, text=True,
    ).stdout.strip()
    return [list(line.replace("_", " ")) for line in out.split("\n") if line.strip()]

def to_ids(phonemes, pmap):
    ids = [pmap["^"][0], pmap["_"][0]]
    for p in phonemes:
        if p in pmap:
            ids.extend(pmap[p])
            ids.append(pmap["_"][0])
    ids.append(pmap["$"][0])
    return ids

text = "Hello, this is a test."
audio_chunks = []
for sentence in phonemize(text, espeak_voice):
    ids = to_ids(sentence, phoneme_id_map)
    if len(ids) < 3:
        continue
    audio = session.run(None, {
        "input": np.array([ids], dtype=np.int64),
        "input_lengths": np.array([len(ids)], dtype=np.int64),
        "scales": np.array([
            config["inference"]["noise_scale"],
            config["inference"]["length_scale"],
            config["inference"]["noise_w"],
        ], dtype=np.float32),
    })[0]
    audio_chunks.append(audio.squeeze())

audio = np.concatenate(audio_chunks).astype(np.float32)
sf.write("output.wav", audio, config["audio"]["sample_rate"])
Fine-tuning

You can fine-tune this model on your own voice data using Trelis Studio . Piper models can be trained on custom datasets to create personalized voices.

Attribution

Trained on data from HuaYan TTS . Fine-tuned from lessac medium.

Re-hosted from rhasspy/piper-voices . Original voice: zh_CN-huayan-medium

Runs of Trelis piper-zh-cn-huayan-medium on huggingface.co

379
Total runs
0
24-hour runs
29
3-day runs
55
7-day runs
-108
30-day runs

More Information About piper-zh-cn-huayan-medium huggingface.co Model

More piper-zh-cn-huayan-medium license Visit here:

https://choosealicense.com/licenses/other

piper-zh-cn-huayan-medium huggingface.co

piper-zh-cn-huayan-medium huggingface.co is an AI model on huggingface.co that provides piper-zh-cn-huayan-medium's model effect (), which can be used instantly with this Trelis piper-zh-cn-huayan-medium model. huggingface.co supports a free trial of the piper-zh-cn-huayan-medium model, and also provides paid use of the piper-zh-cn-huayan-medium. Support call piper-zh-cn-huayan-medium model through api, including Node.js, Python, http.

piper-zh-cn-huayan-medium huggingface.co Url

https://huggingface.co/Trelis/piper-zh-cn-huayan-medium

Trelis piper-zh-cn-huayan-medium online free

piper-zh-cn-huayan-medium huggingface.co is an online trial and call api platform, which integrates piper-zh-cn-huayan-medium's modeling effects, including api services, and provides a free online trial of piper-zh-cn-huayan-medium, you can try piper-zh-cn-huayan-medium online for free by clicking the link below.

Trelis piper-zh-cn-huayan-medium online free url in huggingface.co:

https://huggingface.co/Trelis/piper-zh-cn-huayan-medium

piper-zh-cn-huayan-medium install

piper-zh-cn-huayan-medium is an open source model from GitHub that offers a free installation service, and any user can find piper-zh-cn-huayan-medium on GitHub to install. At the same time, huggingface.co provides the effect of piper-zh-cn-huayan-medium install, users can directly use piper-zh-cn-huayan-medium installed effect in huggingface.co for debugging and trial. It also supports api for free installation.

piper-zh-cn-huayan-medium install url in huggingface.co:

https://huggingface.co/Trelis/piper-zh-cn-huayan-medium

Url of piper-zh-cn-huayan-medium

piper-zh-cn-huayan-medium huggingface.co Url

Provider of piper-zh-cn-huayan-medium huggingface.co

Trelis
ORGANIZATIONS

Other API from Trelis

huggingface.co

Total runs: 617
Run Growth: 202
Growth Rate: 32.74%
Updated:July 21 2026
huggingface.co

Total runs: 70
Run Growth: 70
Growth Rate: 100.00%
Updated:November 21 2025
huggingface.co

Total runs: 55
Run Growth: 0
Growth Rate: 0.00%
Updated:September 18 2024