Skip to main content

seda

PyPI Python License ONNX Hugging Face Ruff uv

Bâki kalan bu kubbede bir hoş sadâ imiş...

— Bâkî

Lightweight, low-latency Turkish speech models for real-time applications.

Seda aims to provide models that are small enough to run on a CPU, fast enough for live audio, accurate enough for production, and available for commercial use. sedalib is the Python package for running them. It currently ships streaming speech recognition (STT) on top of sherpa-onnx.

Models

Model Task Architecture Params Eval
seda-v0.1 Streaming STT Zipformer2 transducer 66.1M 11.52 WER (FLEURS)

WER is measured with beam search (4 paths) and the language model enabled. The model processes audio in 0.64-second chunks, so partial results arrive in real time. See the model card for more benchmarks.

Installation

pip install sedalib

Python 3.10 or newer is required. The only runtime dependencies are sherpa-onnx and huggingface-hub.

Quick start

Transcribe a complete waveform. read_wav loads a 16-bit PCM WAV file as mono float samples in [-1, 1] together with its sample rate:

from sedalib import Recognizer, read_wav

samples, sample_rate = read_wav("audio.wav")

recognizer = Recognizer.from_pretrained()  # downloads the model once and caches it
text = recognizer.transcribe(samples, sample_rate)
print(text)

Audio at other sample rates is resampled automatically.

Streaming

For live audio, open a stream and feed it chunks as they arrive. accept returns the current partial transcript, and is_endpoint tells you when the speaker has finished an utterance.

stream = recognizer.stream()

for chunk in microphone_chunks():  # e.g. 0.64 s of audio at a time
    partial = stream.accept(chunk, sample_rate=16000)
    print(partial)

    if stream.is_endpoint:
        print("final:", stream.text)
        stream.reset()  # start a new utterance

Call stream.finish() at the end of the audio to flush the remaining frames and get the final text. A single Recognizer can serve many independent streams.

Options

Recognizer.from_pretrained(
    "atasoglu/seda-v0.1",  # Hugging Face repo id
    revision=None,  # pin a branch, tag or commit
    use_lm=True,  # rescore with the language model
    num_threads=1,  # CPU threads used for inference
)

The language model improves accuracy at the cost of some extra compute. Pass use_lm=False for the lightest setup. To load a model you have already downloaded, use Recognizer("path/to/model_dir").

Demo

A Gradio demo with live microphone streaming and file transcription is available as an extra:

pip install "sedalib[demo]"
python -m sedalib.demo.stt

Development

uv sync
uv run prek install  # ruff lint and format hooks

License

The code is released under Apache-2.0. The acoustic model is Apache-2.0 as well. The optional language model is CC BY-SA 4.0 because it was trained on Wikipedia data, so pass use_lm=False if that is a concern for your use case.

Metadata

Release files for sedalib 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sedalib 0.2.1
File Size Uploaded Provenance Actions
sedalib-0.2.1.tar.gz 139.9 kB Without provenance Details for sedalib-0.2.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for sedalib 0.2.1
File Interpreter ABI Platform Actions
sedalib-0.2.1-py3-none-any.whl Python 3 none any Details for sedalib-0.2.1-py3-none-any.whl

Total release size: 152.0 kB

Release files / sedalib-0.2.1.tar.gz

Download URL sedalib-0.2.1.tar.gz
Size 139.9 kB
Tags Source
SHA-256 checksum
How to use checksums
bcb4fce69ab4ef5ba5eb36431899f592029e0d7f8b0b30a87e880f030a625228
BLAKE2b-256 checksum
How to use checksums
e904330adf414d083e0da3494dfb6a33f0116273b398320a00b28da09287eb50
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.1 {"installer":{"name":"uv","version":"0.13.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / sedalib-0.2.1-py3-none-any.whl

Download URL sedalib-0.2.1-py3-none-any.whl
Size 12.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a60391600cc3b4fa85294007a4a0687bc14eb0e8b77d5f6d925f925266ebd447
BLAKE2b-256 checksum
How to use checksums
15323deab0b5c1aac5cebeb19da1508cbacaa0e2670f6a65291df123ecab691f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.1 {"installer":{"name":"uv","version":"0.13.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for sedalib 0.2.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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