Automatic Speech Recognition
Transformers
PyTorch
JAX
TensorBoard
ONNX
Safetensors
whisper
audio
asr
hf-asr-leaderboard
Instructions to use NbAiLabBeta/nb-whisper-small with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use NbAiLabBeta/nb-whisper-small with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("automatic-speech-recognition", model="NbAiLabBeta/nb-whisper-small")# Load model directly from transformers import AutoProcessor, AutoModelForSpeechSeq2Seq processor = AutoProcessor.from_pretrained("NbAiLabBeta/nb-whisper-small") model = AutoModelForSpeechSeq2Seq.from_pretrained("NbAiLabBeta/nb-whisper-small") - Notebooks
- Google Colab
- Kaggle
| import json | |
| import requests | |
| def download_template(url): | |
| response = requests.get(url) | |
| response.raise_for_status() | |
| return response.text | |
| def replace_in_file(template, replacements): | |
| for placeholder, replacement in replacements.items(): | |
| template = template.replace(placeholder, replacement) | |
| return template | |
| def main(): | |
| with open('model_def.json', 'r') as file: | |
| model_def = json.load(file) | |
| template_url = model_def["template_url"] | |
| template_content = download_template(template_url) | |
| output_content = replace_in_file(template_content, model_def["replacements"]) | |
| output_filename = 'README.md' | |
| with open(output_filename, 'w') as output_file: | |
| output_file.write(output_content) | |
| print(f'Processed {output_filename}') | |
| if __name__ == "__main__": | |
| main() | |