Instructions to use Xenova/tiny-random-WhisperForConditionalGeneration_timestamped with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers.js
How to use Xenova/tiny-random-WhisperForConditionalGeneration_timestamped with Transformers.js:
// npm i @huggingface/transformers import { pipeline } from '@huggingface/transformers'; // Allocate pipeline const pipe = await pipeline('automatic-speech-recognition', 'Xenova/tiny-random-WhisperForConditionalGeneration_timestamped');
|
Download README.md from Xenova/tiny-random-WhisperForConditionalGeneration_timestamped: direct link, hf CLI and curl.
- Browser
- Download file 831 Bytes
-
https://huggingface.co/Xenova/tiny-random-WhisperForConditionalGeneration_timestamped/resolve/main/README.md
- Command line
-
hf download hf://Xenova/tiny-random-WhisperForConditionalGeneration_timestamped/README.md
-
curl -L -o README.md https://huggingface.co/Xenova/tiny-random-WhisperForConditionalGeneration_timestamped/resolve/main/README.md
831 Bytes
| tags: | |
| - transformers.js | |
| Code to generate: | |
| ```py | |
| from transformers import WhisperForConditionalGeneration, AutoProcessor | |
| new_config_values = dict( | |
| d_model = 16, | |
| decoder_attention_heads = 4, | |
| decoder_layers = 1, | |
| encoder_attention_heads = 4, | |
| encoder_layers = 1, | |
| num_hidden_layers = 1, | |
| ignore_mismatched_sizes=True, | |
| ) | |
| original_model = WhisperForConditionalGeneration.from_pretrained('openai/whisper-tiny', **new_config_values) | |
| original_model.save_pretrained('converted') | |
| original_processor = AutoProcessor.from_pretrained('openai/whisper-tiny') | |
| original_processor.save_pretrained('converted') | |
| ``` | |
| Followed by: | |
| ```sh | |
| $ mkdir -p ./converted/onnx | |
| $ optimum-cli export onnx -m ./converted ./converted/onnx --task automatic-speech-recognition-with-past | |
| $ find ./converted/onnx -type f ! -name "*.onnx" -delete | |
| ``` |