Instructions to use mohammed/quantized-whisper-small with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use mohammed/quantized-whisper-small with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("automatic-speech-recognition", model="mohammed/quantized-whisper-small")# Load model directly from transformers import AutoProcessor, AutoModelForSpeechSeq2Seq processor = AutoProcessor.from_pretrained("mohammed/quantized-whisper-small") model = AutoModelForSpeechSeq2Seq.from_pretrained("mohammed/quantized-whisper-small", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Update README.md
Browse files
README.md
CHANGED
|
@@ -31,9 +31,16 @@ pip install -U optimum[exporters,onnxruntime] transformers
|
|
| 31 |
pip install huggingface_hub
|
| 32 |
|
| 33 |
```python
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 34 |
from optimum.onnxruntime import ORTModelForSpeechSeq2Seq
|
| 35 |
from transformers import WhisperTokenizerFast, WhisperFeatureExtractor, pipeline
|
| 36 |
|
|
|
|
| 37 |
model_name = 'mohammed/quantized-whisper-small' # folder name
|
| 38 |
model = ORTModelForSpeechSeq2Seq.from_pretrained(model_name, export=False)
|
| 39 |
tokenizer = WhisperTokenizerFast.from_pretrained(model_name)
|
|
|
|
| 31 |
pip install huggingface_hub
|
| 32 |
|
| 33 |
```python
|
| 34 |
+
|
| 35 |
+
# uncomment the following installation if you are using a notebook:
|
| 36 |
+
#!pip install -U optimum[exporters,onnxruntime] transformers
|
| 37 |
+
#!pip install huggingface_hub
|
| 38 |
+
|
| 39 |
+
# import the required packages
|
| 40 |
from optimum.onnxruntime import ORTModelForSpeechSeq2Seq
|
| 41 |
from transformers import WhisperTokenizerFast, WhisperFeatureExtractor, pipeline
|
| 42 |
|
| 43 |
+
# set model name/id
|
| 44 |
model_name = 'mohammed/quantized-whisper-small' # folder name
|
| 45 |
model = ORTModelForSpeechSeq2Seq.from_pretrained(model_name, export=False)
|
| 46 |
tokenizer = WhisperTokenizerFast.from_pretrained(model_name)
|