Instructions to use kerasformers/moonshine_tiny with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- KerasFormers
How to use kerasformers/moonshine_tiny 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/moonshine_tiny 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/moonshine_tiny") - Notebooks
- Google Colab
- Kaggle
See our collection for all versions of Moonshine.
Run Moonshine with Keras 3: JAX, PyTorch, or TensorFlow
kerasformers/moonshine_tiny
Paper: Moonshine: Speech Recognition for Live Transcription and Voice Commands (arXiv:2410.15608) · HF Papers
Moonshine is an English ASR encoder-decoder built for short / live audio: the encoder sees the raw waveform length you pass in (no Whisper-style 30 s pad), so short commands stay cheap. Output is cased and punctuated.
For more details on the model, please go to the upstream model card.
Pure-Keras 3 conversion of UsefulSensors/moonshine-tiny for kerasformers. One implementation runs unmodified on TensorFlow / Torch / JAX.
This is an ASR checkpoint (MoonshineSpeechToText).
✨ Quick start
import os
os.environ["KERAS_BACKEND"] = "torch" # or "jax" / "tensorflow"
import soundfile as sf
from kerasformers.models.moonshine import (
MoonshineProcessor,
MoonshineSpeechToText,
)
model = MoonshineSpeechToText.from_weights("kerasformers/moonshine_tiny")
processor = MoonshineProcessor.from_weights("kerasformers/moonshine_tiny")
audio, sr = sf.read("your_audio.wav", dtype="float32") # 16 kHz mono
# Cost scales with clip length: no fixed 30 s pad like Whisper.
text = model.generate(audio, processor)
print(repr(text[0]))
Load any Moonshine variant the same way with from_weights("kerasformers/<variant>"):
| Variant | Hub |
|---|---|
moonshine_tiny |
kerasformers/moonshine_tiny |
moonshine_base |
kerasformers/moonshine_base |
Tips
- Set
KERAS_BACKENDbefore importing Keras / kerasformers. - Prefer
MoonshineProcessor.from_weights(...)so feature extraction matches. - English-only; pass a list of waveforms to batch.
- See Moonshine docs and Loading Weights.
- Community / upstream safetensors still work via the
hf:prefix, e.g.MoonshineSpeechToText.from_weights("hf:UsefulSensors/moonshine-tiny").
Special Thanks
A huge thank you to the Useful Sensors Moonshine authors for creating and releasing these models.
License: MIT.
- Downloads last month
- 47
Model tree for kerasformers/moonshine_tiny
Base model
moonshine-ai/moonshine-tiny