Run this model with HF Jobs
Run zeromodels/moonshine_base on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/zeromodels/moonshine_base. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/zeromodels/moonshine_base on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Instructions to use zeromodels/moonshine_base with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- ZeroModels
How to use zeromodels/moonshine_base with ZeroModels:
# pip install -U zeromodels # ZeroModels is pure Keras 3, so pick a backend: "jax", "torch" or "tensorflow". import os os.environ["KERAS_BACKEND"] = "jax" from zeromodels import AutoZModel # AutoZModel reads the repo's model_type and loads the matching class. # For a task head use the matching loader, e.g. AutoZMImageClassify / AutoZMDetect / # AutoZMSemanticSegment / AutoZMTextGenerate (see zeromodels.auto). model = AutoZModel.from_weights("zeromodels/moonshine_base") - Keras
How to use zeromodels/moonshine_base with Keras:
# !pip install -U keras tensorflow huggingface_hub # Keras needs TensorFlow installed to read "hf://" paths, so the tensorflow backend is selected here; # "jax" and "torch" also work for computation once TensorFlow is installed. import os os.environ["KERAS_BACKEND"] = "tensorflow" import keras model = keras.saving.load_model("hf://zeromodels/moonshine_base") - Notebooks
- Google Colab
- Kaggle
fix readme.md
Browse files12345678910111213141516171819202122---pipeline_tag: automatic-speech-recognitionlicense: mitlibrary_name: kerasformerstags:- keras- kerasformers- moonshine- tf- jax- pytorch---# moonshine_base (Keras 3)Pure-Keras 3 weights for [kerasformers](https://github.com/IMvision12/KerasFormers), mirrored from the GitHub release. License: `mit`.```pythonfrom kerasformers.models.moonshine import MoonshineSpeechToText, MoonshineProcessormodel = MoonshineSpeechToText.from_weights("moonshine_base")processor = MoonshineProcessor.from_weights("moonshine_base")```12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576---pipeline_tag: automatic-speech-recognitionlicense: mitbase_model: UsefulSensors/moonshine-baselibrary_name: kerasformerstags:- keras- kerasformers- moonshine- automatic-speech-recognition- audio- arxiv:2410.15608- pytorch- jax- tf---## ***See [our collection](https://huggingface.co/collections/kerasformers/moonshine-6a6acc6dae5ff619b873d6c9) for all versions of Moonshine.***# Run Moonshine with Keras 3: JAX, PyTorch, or TensorFlow[](https://github.com/IMvision12/KerasFormers) [](https://imvision12.github.io/KerasFormers/moonshine/) [](https://huggingface.co/collections/kerasformers/moonshine-6a6acc6dae5ff619b873d6c9)# kerasformers/moonshine_basePaper: [Moonshine: Speech Recognition for Live Transcription and Voice Commands (arXiv:2410.15608)](https://arxiv.org/abs/2410.15608) · [HF Papers](https://huggingface.co/papers/2410.15608)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](https://huggingface.co/UsefulSensors/moonshine-base).Pure-**Keras 3** conversion of [`UsefulSensors/moonshine-base`](https://huggingface.co/UsefulSensors/moonshine-base) for [kerasformers](https://github.com/IMvision12/KerasFormers). One implementation runs unmodified on **TensorFlow / Torch / JAX**.This is an **ASR** checkpoint (`MoonshineSpeechToText`).## ✨ Quick start```pythonimport osos.environ["KERAS_BACKEND"] = "torch" # or "jax" / "tensorflow"import soundfile as sffrom kerasformers.models.moonshine import (MoonshineProcessor,MoonshineSpeechToText,)model = MoonshineSpeechToText.from_weights("kerasformers/moonshine_base")processor = MoonshineProcessor.from_weights("kerasformers/moonshine_base")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`](https://huggingface.co/kerasformers/moonshine_tiny) || `moonshine_base` | [`kerasformers/moonshine_base`](https://huggingface.co/kerasformers/moonshine_base) |## Tips- Set `KERAS_BACKEND` **before** importing Keras / kerasformers.- Prefer `MoonshineProcessor.from_weights(...)` so feature extraction matches.- English-only; pass a list of waveforms to batch.- See [Moonshine docs](https://imvision12.github.io/KerasFormers/moonshine/) and [Loading Weights](https://imvision12.github.io/KerasFormers/loading_weights/).- Community / upstream safetensors still work via the `hf:` prefix, e.g. `MoonshineSpeechToText.from_weights("hf:UsefulSensors/moonshine-base")`.## Special ThanksA huge thank you to the Useful Sensors Moonshine authors for creating and releasing these models.License: MIT.
README.md+61-7