Automatic Speech Recognition
Transformers
Safetensors
granite_speech
Eval Results
gsaon commited on
Commit
1f5703d
·
verified ·
1 Parent(s): f74f3cc

added mlx-audio support

Browse files
Files changed (1) hide show
  1. README.md +27 -0
README.md CHANGED
@@ -237,6 +237,33 @@ print(f"Audio Example - Question: {question}")
237
  print(f"Generated text: {chat_completion_with_audio.choices[0].message.content}")
238
  ```
239
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
240
  **Model Architecture:**
241
 
242
  The architecture of granite-4.0-1b-speech consists of the following components:
 
237
  print(f"Generated text: {chat_completion_with_audio.choices[0].message.content}")
238
  ```
239
 
240
+ ### Usage with `mlx-audio` for Apple Silicon M series chips
241
+
242
+ First, install a recent version of mlx-audio (0.4.1 or later):
243
+ ```shell
244
+ pip install -U mlx-audio
245
+ ```
246
+ CLI:
247
+ ```shell
248
+ python -m mlx_audio.stt.generate --model ibm-granite/granite-4.0-1b-speech --verbose --audio "audio.wav" --output-path "transcript"
249
+ ```
250
+ Python:
251
+ ```python
252
+ from mlx_audio.stt.utils import load_model
253
+ from mlx_audio.stt.generate import generate_transcription
254
+
255
+ model = load_model("mlx-community/granite-4.0-1b-speech-8bit")
256
+ transcription = generate_transcription(
257
+ model=model,
258
+ audio="audio.wav",
259
+ output_path="transcript.txt",
260
+ format="txt",
261
+ verbose=True,
262
+ )
263
+ print(transcription.text)
264
+ ```
265
+ (other quantizations available at [mlx-community](https://huggingface.co/mlx-community))
266
+
267
  **Model Architecture:**
268
 
269
  The architecture of granite-4.0-1b-speech consists of the following components: