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
File size: 822 Bytes
75f6dfc | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | 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()
|