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") - Notebooks
- Google Colab
- Kaggle
| library_name: transformers | |
| tags: [] | |
| # Model Card for Model ID | |
| <!-- Provide a quick summary of what the model is/does. --> | |
| ## Model Details | |
| ### Model Description | |
| This is a quantized model of the original version mohammed/whisper-small-arabic-cv-11 | |
| - **Developed by:** Mohammed Bakheet | |
| - **Funded by [optional]:** Kalam Technology | |
| - **Language(s) (NLP):** Arabic, English | |
| ## Uses | |
| This a quantized model that reads arabic voice and transcribes/translate it into english | |
| ### Direct Use | |
| First, install the following packages using the following commands: | |
| pip install -U optimum[exporters,onnxruntime] transformers | |
| pip install huggingface_hub | |
| ```python | |
| # uncomment the following installation if you are using a notebook: | |
| #!pip install -U optimum[exporters,onnxruntime] transformers | |
| #!pip install huggingface_hub | |
| # import the required packages | |
| from optimum.onnxruntime import ORTModelForSpeechSeq2Seq | |
| from transformers import WhisperTokenizerFast, WhisperFeatureExtractor, pipeline | |
| # set model name/id | |
| model_name = 'mohammed/quantized-whisper-small' # folder name | |
| model = ORTModelForSpeechSeq2Seq.from_pretrained(model_name, export=False) | |
| tokenizer = WhisperTokenizerFast.from_pretrained(model_name) | |
| feature_extractor = WhisperFeatureExtractor.from_pretrained(model_name) | |
| forced_decoder_ids = tokenizer.get_decoder_prompt_ids(language="ar", task="transcribe") | |
| pipe = pipeline('automatic-speech-recognition', | |
| model=model, | |
| tokenizer=tokenizer, | |
| feature_extractor=feature_extractor, | |
| model_kwargs={"forced_decoder_ids": forced_decoder_ids}) | |
| # the file to be transcribed | |
| pipe('Recording.mp3') | |
| ``` | |
| ### Out-of-Scope Use | |
| <!-- This section addresses misuse, malicious use, and uses that the model will not work well for. --> | |
| The model does a direct translation of Arabic speech, and doesn't do a direct transcription, we are still working on that. | |
| ### Recommendations | |
| <!-- This section is meant to convey recommendations with respect to the bias, risk, and technical limitations. --> | |
| Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations. | |
| ## How to Get Started with the Model | |
| Use the code below to get started with the model. | |
| ```python | |
| First, install the following packages using the following commands: | |
| pip install -U optimum[exporters,onnxruntime] transformers | |
| pip install huggingface_hub | |
| from optimum.onnxruntime import ORTModelForSpeechSeq2Seq | |
| from transformers import WhisperTokenizerFast, WhisperFeatureExtractor, pipeline | |
| model_name = 'mohammed/quantized-whisper-small' # folder name | |
| model = ORTModelForSpeechSeq2Seq.from_pretrained(model_name, export=False) | |
| tokenizer = WhisperTokenizerFast.from_pretrained(model_name) | |
| feature_extractor = WhisperFeatureExtractor.from_pretrained(model_name) | |
| forced_decoder_ids = tokenizer.get_decoder_prompt_ids(language="ar", task="transcribe") | |
| pipe = pipeline('automatic-speech-recognition', | |
| model=model, | |
| tokenizer=tokenizer, | |
| feature_extractor=feature_extractor, | |
| model_kwargs={"forced_decoder_ids": forced_decoder_ids}) | |
| # the file to be transcribed | |
| pipe('Recording.mp3') | |
| ``` | |
| ### Training Data | |
| Please refer to the original model at "mohammed/whisper-small-arabic-cv-11" | |
| ### Training Procedure | |
| Please refer to the original model at "mohammed/whisper-small-arabic-cv-11" | |
| #### Preprocessing [optional] | |
| Please refer to the original model at "mohammed/whisper-small-arabic-cv-11" | |
| #### Training Hyperparameters | |
| - **Training regime:** Please refer to the original model at "mohammed/whisper-small-arabic-cv-11" | |