CoolFace
Modelpublic

elgehelge/plapre-onnx-web

sourceHugging Facecc-by-4.0updated 3mo agoView on Hugging Face
0likes
Model Card

Plapre — ONNX weights for in-browser inference

Converted ONNX artifacts for running **Plapre**, an open-source Danish text-to-speech model, fully in the browser on `onnxruntime-web` (WebGPU, with a WASM fallback).

These files are consumed by the **plapre-in-a-browser** library and its live demo. They are a format conversion (PyTorch → ONNX) of the upstream model — no retraining — verified to reproduce the PyTorch reference to float precision.

Files

<variant> is pico or nano (see below); the Kanade files are shared.

FileStageNotes
<variant>/lm/model.onnx (+ meta.json)Plapre language modelSmolLM2/LLaMA, autoregressive
kanade_decoder.onnx (+ .onnx.data)Kanade decoderaudio tokens + speaker emb → mel
hift_vocoder.onnx (+ .onnx.data)HiFT vocodermel → 24 kHz waveform
clone_encoder.onnxKanade clone encoderreference audio → 128-dim speaker embedding
<variant>/tokenizer.json, config.jsontokenizer / configBPE + special audio tokens
<variant>/speakers.json, speaker_proj.jsonbuilt-in voicesprecomputed embeddings (tor, ida, liv, ask, kaj)

Model variants

The repo hosts both Plapre sizes. The LM-side files above are variant-specific and live under each variant's directory: Pico (hidden 576) under pico/ and Nano (hidden 960) under nano/ (e.g. pico/lm/model.onnx, nano/lm/model.onnx). The Kanade kanade_decoder.*, hift_vocoder.*, and clone_encoder.onnx are shared across variants and stay at the root. Select a variant with loadPlapreEngine({ model: "pico" | "nano" }).

Usage

ts
import { loadPlapreEngine } from "plapre-in-a-browser";

const engine = await loadPlapreEngine({
  modelsBaseUrl: "https://huggingface.co/elgehelge/plapre-onnx-web/resolve/main",
});
const { samples, sampleRate } = await engine.synthesizeToPcm({
  text: "Hej, hvordan har du det i dag?",
  voice: "ida",
});

License & attribution

Distributed under CC BY 4.0 (the most restrictive of the upstream licenses). Each artifact derives from a permissively licensed work:

ArtifactUpstreamLicense
<variant>/lm/*, tokenizer.json, config.json, speakers.json, speaker_proj.jsonPlapre Pico / Nano by syv.aiCC BY 4.0
kanade_decoder.*, clone_encoder.onnxKanade (frothywater)MIT
hift_vocoder.*HiFT, from CosyVoice 2Apache-2.0
clone-encoder SSL frontendWavLM (Microsoft)MIT

These are format conversions (PyTorch → ONNX), not retraining. If you redistribute these artifacts, keep this attribution and the MIT/Apache notices. Full notices: https://github.com/elgehelge/plapre-in-a-browser/blob/main/NOTICE