Text-to-Speech
MLX
PyTorch
Portuguese
tts
pt-br
brazilian-portuguese
tinyml
esp32
esp32-s3
microcontroller
embedded
quantized
int8
4-bit precision
fargan
pingo
webassembly
javascript
Instructions to use semfence/pingo-ptbr-edge with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use semfence/pingo-ptbr-edge with MLX:
# Download the model from the Hub pip install huggingface_hub[hf_xet] hf download semfence/pingo-ptbr-edge --local-dir pingo-ptbr-edge
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- LM Studio
- Atomic Chat
File size: 839 Bytes
76d09f0 3559195 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | """Pingo acoustic model in MLX with the firmware's 4-bit weights, dequantized."""
import numpy as np
import mlx.core as mx
from mlx.utils import tree_flatten, tree_unflatten
from . import weights as W
from . import acoustic_mlx as A
class AcousticMLX:
def __init__(self, path=W.DEFAULT):
z, meta = W.load(path); cfg, ac = W.acoustic(z, meta)
self.cfg = cfg; self.model = A.Acoustic(cfg)
flat = [(k, mx.array(np.ascontiguousarray(ac[W.cname(k)].reshape(v.shape)))) for k, v in tree_flatten(self.model.parameters())]
self.model.update(tree_unflatten(flat)); mx.eval(self.model.parameters())
def features(self, ids, stress, voice, speed=1.0, phone_mask=None):
return A.acoustic_features(self.model, [int(i) for i in ids], [int(i) for i in stress], int(voice), speed, np.asarray(phone_mask))
|