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
Download python/pingo_edge/__main__.py from semfence/pingo-ptbr-edge: direct link, hf CLI and curl.
- Browser
- Download file 1.06 kB
-
https://huggingface.co/semfence/pingo-ptbr-edge/resolve/main/python/pingo_edge/__main__.py
- Command line
-
hf download hf://semfence/pingo-ptbr-edge/python/pingo_edge/__main__.py
-
curl -L -o __main__.py https://huggingface.co/semfence/pingo-ptbr-edge/resolve/main/python/pingo_edge/__main__.py
1.06 kB
| """python -m pingo_edge --backend torch|mlx --text "Olá, eu sou a voz da SemFence." -o out.wav""" | |
| import argparse, time | |
| import soundfile as sf | |
| from .frontend import Pingo, speak, VOICES, RATE | |
| ap = argparse.ArgumentParser(prog="pingo_edge", description="pingo-ptbr edge (acústico 4 bits + vocoder xxs int8) em PyTorch ou MLX") | |
| ap.add_argument("--backend", choices=["torch", "mlx"], default="torch") | |
| ap.add_argument("--voice", choices=list(VOICES), default="F_s4") | |
| ap.add_argument("--text", required=True); ap.add_argument("--speed", type=float, default=1.0) | |
| ap.add_argument("--no-respelling", action="store_true", help="não reescrever termos em inglês") | |
| ap.add_argument("-o", "--output", default="out.wav") | |
| a = ap.parse_args() | |
| t0 = time.time(); p = Pingo(a.backend); t1 = time.time() | |
| y = speak(p, a.text, a.voice, a.speed, not a.no_respelling); t2 = time.time() | |
| sf.write(a.output, y, RATE); print(f"{a.output}: {len(y) / RATE:.2f} s de áudio | carga {t1 - t0:.1f} s | síntese {t2 - t1:.1f} s ({len(y) / RATE / (t2 - t1):.1f}x tempo real) | {a.backend}") | |