Automatic Speech Recognition
Transformers
PyTorch
TensorBoard
whisper
whisper-event
Generated from Trainer
hf-asr-leaderboard
Eval Results (legacy)
Instructions to use arbml/whisper-small-ar with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use arbml/whisper-small-ar with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("automatic-speech-recognition", model="arbml/whisper-small-ar")# Load model directly from transformers import AutoProcessor, AutoModelForSpeechSeq2Seq processor = AutoProcessor.from_pretrained("arbml/whisper-small-ar") model = AutoModelForSpeechSeq2Seq.from_pretrained("arbml/whisper-small-ar") - Notebooks
- Google Colab
- Kaggle
| import soundfile as sf | |
| import os | |
| os.makedirs("dataset", exist_ok=True) | |
| archive_path = "test" | |
| wav_dir = os.path.join(archive_path, "wav") | |
| segments_file = os.path.join(archive_path, "text.all") | |
| with open(segments_file, "r", encoding="utf-8") as f: | |
| for _id, line in enumerate(f): | |
| segment = line.split(" ")[0] | |
| text = " ".join(line.split(" ")[1:]) | |
| wav_name, _, time = segment.split("_") | |
| time = time.replace("seg-", "") | |
| start, stop = time.split(":") | |
| start = int(int(start) / 100 * 16_000) | |
| stop = int(int(stop) / 100 * 16_000) | |
| wav_path = os.path.join(wav_dir, wav_name + ".wav") | |
| sound, _ = sf.read(wav_path, start=start, stop=stop) | |
| sf.write(f"dataset/{segment}.wav", sound, 16_000) | |
| open(f"dataset/{segment}.txt", "w").write(text) | |