Skip to main content
Yanked

This release has been yanked by its maintainers, and will be ignored by installers, except when explicitly specified.
Consider using release 2.2.0 instead.
Reason given by maintainers: Incompatible with the current samuel-vitorino/sopro-v2-turbo artifacts. Upgrade to sopro>=2.2.0.

Sopro V2

Sopro TTS

Blog HuggingFace ONNX Demo

Sopro (from the Portuguese word for "breath/blow") is a lightweight voice-cloning text-to-speech model family. This repo ships sopro-v2-turbo, a 120M-parameter open model that streams, runs comfortably on a laptop CPU or in the browser, and reaches SOTA-level intelligibility against much larger systems. The full story, evaluations, and audio samples are in the blog post.

Main features:

  • 120M parameters
  • English, European Portuguese, French, and German
  • Streaming with ~300 ms time-to-first-audio on a laptop CPU
  • Zero-shot voice cloning from 5-20 seconds of reference audio
  • 0.24 RTF offline / 0.21 RTF streaming on an M3 CPU, 0.07 RTF on an H100
  • Runs in the browser via an ONNX runtime

Local demo

Run the model and open the demo with one command:

uvx --from sopro soprotts serve

If Sopro is already installed:

soprotts serve

Then navigate to http://localhost:7860. The model downloads on first use and stays in the Hugging Face cache. Sopro selects CUDA or CPU automatically and defaults to CPU on macOS (pass --device mps explicitly to use MPS). Use soprotts serve --help for model, device, port, and CPU int8 options.

Browser demo

There is also a fully in-browser demo with no server involved: https://samuel-vitorino.github.io/sopro/. On mobile the model is quantized, so results can be slightly below the local demo, and devices with low memory may crash. The dependency-isolated ONNX runtime and exporter are documented in web/README.md. Both demos use the frontend in demos/web.


Installation

From PyPI

pip install -U sopro

From the repo

git clone https://github.com/samuel-vitorino/sopro
cd sopro
pip install -e .

Examples

CLI

soprotts "Sopro is a lightweight 120 million parameter text-to-speech model that streams and runs on device." --ref ref.wav --out out.wav

Add --stream for the streaming path. You have the expected --temperature, --top-p, and --top-k parameters, alongside:

  • --lang (en, pt, fr, de; optional, helps pronunciation on ambiguous text)
  • --int8 (int8 AR weights on CPU)
  • --steps (acoustic solver steps; default 2). If you want to trade speed for quality, 8, 16, or even 32 steps can give higher quality speech on more challenging references
  • --max-seconds (cap per generated segment; long text is split into segments, so total length is unbounded)

Python

Non-streaming

from sopro import SoproTTS

tts = SoproTTS.from_pretrained("samuel-vitorino/sopro-v2-turbo", device="cpu")

wav = tts.synthesize(
    "Hello! This is a non-streaming Sopro TTS example.",
    ref_audio_path="ref.wav",
)

tts.save_wav("out.wav", wav)

Streaming

import torch
from sopro import SoproTTS

tts = SoproTTS.from_pretrained("samuel-vitorino/sopro-v2-turbo", device="cpu")

chunks = []
for chunk in tts.stream(
    "Hello! This is a streaming Sopro TTS example.",
    ref_audio_path="ref.mp3",
):
    chunks.append(chunk.cpu())

wav = torch.cat(chunks, dim=-1)
tts.save_wav("out_stream.wav", wav)

You can also precalculate the reference to reduce time-to-first-audio:

import torch
from sopro import SoproTTS

tts = SoproTTS.from_pretrained("samuel-vitorino/sopro-v2-turbo", device="cpu")

ref = tts.prepare_reference(ref_audio_path="ref.mp3", stream=True)

chunks = []
for chunk in tts.stream(
    "Hello! This is a streaming Sopro TTS example.",
    ref=ref,
):
    chunks.append(chunk.cpu())

wav = torch.cat(chunks, dim=-1)
tts.save_wav("out_stream.wav", wav)

Disclaimers

  • We did not add watermarking: with an open-source inference pipeline it would be trivial to remove, so it would only provide a false sense of safety. Please use the model for good: do not impersonate people.
  • The text frontend is deliberately minimal, so some abbreviations, numbers, and symbols may not be pronounced correctly. Prefer words: 1 + 2 should be written one plus two. That said, Sopro generally reads common abbreviations like "CPU" or "TTS" fine, and you can put a language-specific normalizer in front of it.
  • Mixed-language text is a weak spot: words from one language inside a sentence of another (an English product name in a Portuguese sentence, for example) can be mispronounced.
  • The streaming path (chunked attention and the causal vocoder) is not bit-exact with the offline path. For best quality, prefer the offline path.
  • We are not planning to release the training code in the near future due to its complexity.

Training data


Acknowledgements

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sopro-2.1.1.tar.gz (55.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sopro-2.1.1-py3-none-any.whl (63.8 kB view details)

Uploaded Python 3

File details

Details for the file sopro-2.1.1.tar.gz.

File metadata

  • Download URL: sopro-2.1.1.tar.gz
  • Upload date:
  • Size: 55.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.20

File hashes

Hashes for sopro-2.1.1.tar.gz
Algorithm Hash digest
SHA256 945c577f5543205358ac4a43cb757f652b454f4c9c6f0b680181ee29a673d7bd
MD5 353147c2aab155f3c89a495abffcda09
BLAKE2b-256 ec7e6653ccacf27e4bd38bb0fb1490a80b16760a305a141c58b93e3f91059bbb

See more details on using hashes here.

File details

Details for the file sopro-2.1.1-py3-none-any.whl.

File metadata

  • Download URL: sopro-2.1.1-py3-none-any.whl
  • Upload date:
  • Size: 63.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.20

File hashes

Hashes for sopro-2.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c884ceaae84798563c8eb6539760055fba795fb390ec54c1e15699bb897bc8d9
MD5 36f08e07800ffe273873b84a710f9b22
BLAKE2b-256 4c193b9c59443508bb111bdfd7c06c4f9aadf956f92e1dd631eb3dd272eb9675

See more details on using hashes here.

Release history Release notifications | RSS feed

2.2.0

2 files

This release

2.1.1 This release

2 files

2.1.0

2 files

2.0.5

2 files

2.0.4

2 files

2.0.3

2 files

2.0.2

2 files

2.0.1

2 files

2.0.0

2 files

1.5.0

2 files

1.0.2

2 files

1.0.1

2 files

1.0.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page