Instructions to use zeromodels/moonshine_tiny with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- ZeroModels
How to use zeromodels/moonshine_tiny 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_tiny") - Keras
How to use zeromodels/moonshine_tiny 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_tiny") - Notebooks
- Google Colab
- Kaggle
Update class name in the quick start
Browse files
README.md
CHANGED
|
@@ -31,7 +31,7 @@ For more details on the model, please go to the upstream [model card](https://hu
|
|
| 31 |
|
| 32 |
Pure-**Keras 3** conversion of [`UsefulSensors/moonshine-tiny`](https://huggingface.co/UsefulSensors/moonshine-tiny) for [kerasformers](https://github.com/IMvision12/KerasFormers). One implementation runs unmodified on **TensorFlow / Torch / JAX**.
|
| 33 |
|
| 34 |
-
This is an **ASR** checkpoint (`
|
| 35 |
|
| 36 |
## ✨ Quick start
|
| 37 |
|
|
@@ -42,10 +42,10 @@ os.environ["KERAS_BACKEND"] = "torch" # or "jax" / "tensorflow"
|
|
| 42 |
import soundfile as sf
|
| 43 |
from kerasformers.models.moonshine import (
|
| 44 |
MoonshineProcessor,
|
| 45 |
-
|
| 46 |
)
|
| 47 |
|
| 48 |
-
model =
|
| 49 |
processor = MoonshineProcessor.from_weights("kerasformers/moonshine_tiny")
|
| 50 |
|
| 51 |
audio, sr = sf.read("your_audio.wav", dtype="float32") # 16 kHz mono
|
|
@@ -67,7 +67,7 @@ Load any Moonshine variant the same way with `from_weights("kerasformers/<varian
|
|
| 67 |
- Prefer `MoonshineProcessor.from_weights(...)` so feature extraction matches.
|
| 68 |
- English-only; pass a list of waveforms to batch.
|
| 69 |
- See [Moonshine docs](https://imvision12.github.io/KerasFormers/moonshine/) and [Loading Weights](https://imvision12.github.io/KerasFormers/loading_weights/).
|
| 70 |
-
- Community / upstream safetensors still work via the `hf:` prefix, e.g. `
|
| 71 |
|
| 72 |
## Special Thanks
|
| 73 |
|
|
|
|
| 31 |
|
| 32 |
Pure-**Keras 3** conversion of [`UsefulSensors/moonshine-tiny`](https://huggingface.co/UsefulSensors/moonshine-tiny) for [kerasformers](https://github.com/IMvision12/KerasFormers). One implementation runs unmodified on **TensorFlow / Torch / JAX**.
|
| 33 |
|
| 34 |
+
This is an **ASR** checkpoint (`MoonshineConditionalGenerate`).
|
| 35 |
|
| 36 |
## ✨ Quick start
|
| 37 |
|
|
|
|
| 42 |
import soundfile as sf
|
| 43 |
from kerasformers.models.moonshine import (
|
| 44 |
MoonshineProcessor,
|
| 45 |
+
MoonshineConditionalGenerate,
|
| 46 |
)
|
| 47 |
|
| 48 |
+
model = MoonshineConditionalGenerate.from_weights("kerasformers/moonshine_tiny")
|
| 49 |
processor = MoonshineProcessor.from_weights("kerasformers/moonshine_tiny")
|
| 50 |
|
| 51 |
audio, sr = sf.read("your_audio.wav", dtype="float32") # 16 kHz mono
|
|
|
|
| 67 |
- Prefer `MoonshineProcessor.from_weights(...)` so feature extraction matches.
|
| 68 |
- English-only; pass a list of waveforms to batch.
|
| 69 |
- See [Moonshine docs](https://imvision12.github.io/KerasFormers/moonshine/) and [Loading Weights](https://imvision12.github.io/KerasFormers/loading_weights/).
|
| 70 |
+
- Community / upstream safetensors still work via the `hf:` prefix, e.g. `MoonshineConditionalGenerate.from_weights("hf:UsefulSensors/moonshine-tiny")`.
|
| 71 |
|
| 72 |
## Special Thanks
|
| 73 |
|