Instructions to use kerasformers/s2t-medium-librispeech-asr with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- KerasFormers
How to use kerasformers/s2t-medium-librispeech-asr with KerasFormers:
# No code snippets available yet for this library. # To use this model, check the repository files and the library's documentation. # Want to help? PRs adding snippets are welcome at: # https://github.com/huggingface/huggingface.js
- Keras
How to use kerasformers/s2t-medium-librispeech-asr with Keras:
# Available backend options are: "jax", "torch", "tensorflow". import os os.environ["KERAS_BACKEND"] = "jax" import keras model = keras.saving.load_model("hf://kerasformers/s2t-medium-librispeech-asr") - Notebooks
- Google Colab
- Kaggle
See our collection for all versions of Speech2Text.
Run Speech2Text with Keras 3: JAX, PyTorch, or TensorFlow
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_BACKENDbefore 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
Model tree for kerasformers/s2t-medium-librispeech-asr
Base model
facebook/s2t-medium-librispeech-asr