Instructions to use ibm-granite/granite-4.0-1b-speech with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use ibm-granite/granite-4.0-1b-speech with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("automatic-speech-recognition", model="ibm-granite/granite-4.0-1b-speech")# Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("ibm-granite/granite-4.0-1b-speech") model = AutoModelForMultimodalLM.from_pretrained("ibm-granite/granite-4.0-1b-speech", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Update README.md
Browse files
README.md
CHANGED
|
@@ -82,7 +82,7 @@ model = AutoModelForSpeechSeq2Seq.from_pretrained(
|
|
| 82 |
)
|
| 83 |
|
| 84 |
# Load audio
|
| 85 |
-
audio_path = hf_hub_download(repo_id=model_name, filename="
|
| 86 |
wav, sr = torchaudio.load(audio_path, normalize=True)
|
| 87 |
assert wav.shape[0] == 1 and sr == 16000 # mono, 16kHz
|
| 88 |
|
|
|
|
| 82 |
)
|
| 83 |
|
| 84 |
# Load audio
|
| 85 |
+
audio_path = hf_hub_download(repo_id=model_name, filename="multilingual_sample.wav")
|
| 86 |
wav, sr = torchaudio.load(audio_path, normalize=True)
|
| 87 |
assert wav.shape[0] == 1 and sr == 16000 # mono, 16kHz
|
| 88 |
|