Instructions to use zeromodels/whisper_tiny with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- ZeroModels
How to use zeromodels/whisper_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/whisper_tiny") - Keras
How to use zeromodels/whisper_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/whisper_tiny") - Notebooks
- Google Colab
- Kaggle
Update class name in the quick start
Browse files
README.md
CHANGED
|
@@ -32,7 +32,7 @@ For more details on the model, please go to the upstream [model card](https://hu
|
|
| 32 |
|
| 33 |
Pure-**Keras 3** conversion of [`openai/whisper-tiny`](https://huggingface.co/openai/whisper-tiny) for [kerasformers](https://github.com/IMvision12/KerasFormers). One implementation runs unmodified on **TensorFlow / Torch / JAX**.
|
| 34 |
|
| 35 |
-
This is an **ASR** checkpoint (`
|
| 36 |
|
| 37 |
## ✨ Quick start
|
| 38 |
|
|
@@ -43,10 +43,10 @@ os.environ["KERAS_BACKEND"] = "torch" # or "jax" / "tensorflow"
|
|
| 43 |
import soundfile as sf
|
| 44 |
from kerasformers.models.whisper import (
|
| 45 |
WhisperProcessor,
|
| 46 |
-
|
| 47 |
)
|
| 48 |
|
| 49 |
-
model =
|
| 50 |
processor = WhisperProcessor.from_weights("kerasformers/whisper_tiny")
|
| 51 |
|
| 52 |
audio, sr = sf.read("your_audio.wav", dtype="float32") # 16 kHz mono
|
|
@@ -74,7 +74,7 @@ Load any Whisper variant the same way with `from_weights("kerasformers/<variant>
|
|
| 74 |
- Prefer `WhisperProcessor.from_weights(...)` so mel bins match the variant (v3 uses 128).
|
| 75 |
- Clips are padded to a 30 s window; chunk longer audio yourself.
|
| 76 |
- See [Whisper docs](https://imvision12.github.io/KerasFormers/whisper/) and [Loading Weights](https://imvision12.github.io/KerasFormers/loading_weights/).
|
| 77 |
-
- Community / upstream safetensors still work via the `hf:` prefix, e.g. `
|
| 78 |
|
| 79 |
## Special Thanks
|
| 80 |
|
|
|
|
| 32 |
|
| 33 |
Pure-**Keras 3** conversion of [`openai/whisper-tiny`](https://huggingface.co/openai/whisper-tiny) for [kerasformers](https://github.com/IMvision12/KerasFormers). One implementation runs unmodified on **TensorFlow / Torch / JAX**.
|
| 34 |
|
| 35 |
+
This is an **ASR** checkpoint (`WhisperConditionalGenerate`, 39M).
|
| 36 |
|
| 37 |
## ✨ Quick start
|
| 38 |
|
|
|
|
| 43 |
import soundfile as sf
|
| 44 |
from kerasformers.models.whisper import (
|
| 45 |
WhisperProcessor,
|
| 46 |
+
WhisperConditionalGenerate,
|
| 47 |
)
|
| 48 |
|
| 49 |
+
model = WhisperConditionalGenerate.from_weights("kerasformers/whisper_tiny")
|
| 50 |
processor = WhisperProcessor.from_weights("kerasformers/whisper_tiny")
|
| 51 |
|
| 52 |
audio, sr = sf.read("your_audio.wav", dtype="float32") # 16 kHz mono
|
|
|
|
| 74 |
- Prefer `WhisperProcessor.from_weights(...)` so mel bins match the variant (v3 uses 128).
|
| 75 |
- Clips are padded to a 30 s window; chunk longer audio yourself.
|
| 76 |
- See [Whisper docs](https://imvision12.github.io/KerasFormers/whisper/) and [Loading Weights](https://imvision12.github.io/KerasFormers/loading_weights/).
|
| 77 |
+
- Community / upstream safetensors still work via the `hf:` prefix, e.g. `WhisperConditionalGenerate.from_weights("hf:openai/whisper-tiny")`.
|
| 78 |
|
| 79 |
## Special Thanks
|
| 80 |
|