See our collection for all versions of Speech2Text.

Run Speech2Text with Keras 3: JAX, PyTorch, or TensorFlow

GitHub Docs Collection

kerasformers/s2t-medium-librispeech-asr

Paper: fairseq S2T: Fast Speech-to-Text Modeling with fairseq (arXiv:2010.05171) · HF Papers

Speech2Text (fairseq S2T) is a classic encoder-decoder ASR model trained on LibriSpeech. Transcripts are lowercase and unpunctuated, matching the training label style (unlike Whisper / Moonshine casing).

For more details on the model, please go to the upstream model card.

Pure-Keras 3 conversion of facebook/s2t-medium-librispeech-asr for kerasformers. One implementation runs unmodified on TensorFlow / Torch / JAX.

This is an ASR checkpoint (Speech2TextSpeechToText, medium).

✨ Quick start

import os
os.environ["KERAS_BACKEND"] = "torch"  # or "jax" / "tensorflow"

import soundfile as sf
from kerasformers.models.speech2text import (
    Speech2TextProcessor,
    Speech2TextSpeechToText,
)

model = Speech2TextSpeechToText.from_weights("kerasformers/s2t-medium-librispeech-asr")
processor = Speech2TextProcessor.from_weights("kerasformers/s2t-medium-librispeech-asr")

audio, sr = sf.read("your_audio.wav", dtype="float32")  # 16 kHz mono
text = model.generate(audio, processor)
print(repr(text[0]))  # lowercase, unpunctuated LibriSpeech style

Load any Speech2Text variant the same way with from_weights("kerasformers/<variant>"):

Variant Hub
s2t-small-librispeech-asr kerasformers/s2t-small-librispeech-asr
s2t-medium-librispeech-asr kerasformers/s2t-medium-librispeech-asr
s2t-large-librispeech-asr kerasformers/s2t-large-librispeech-asr

Tips

  • Set KERAS_BACKEND before importing Keras / kerasformers.
  • Prefer Speech2TextProcessor.from_weights(...) so fbank settings match.
  • Pass a list of waveforms to batch (extractor pads to a common length).
  • See Speech2Text docs and Loading Weights.
  • Community / upstream safetensors still work via the hf: prefix, e.g. Speech2TextSpeechToText.from_weights("hf:facebook/s2t-medium-librispeech-asr").

Special Thanks

A huge thank you to the Facebook fairseq S2T authors for creating and releasing these models.

License: MIT.

Downloads last month
39
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for kerasformers/s2t-medium-librispeech-asr

Finetuned
(1)
this model

Collection including kerasformers/s2t-medium-librispeech-asr

Paper for kerasformers/s2t-medium-librispeech-asr