Kleber commited on
Commit
24126b7
1 Parent(s): 611ec1b

Create README.md

Browse files
Files changed (1) hide show
  1. README.md +31 -0
README.md ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ pipeline_tag: automatic-speech-recognition
3
+ datasets:
4
+ - mozilla-foundation/common_voice_11_0
5
+ ---
6
+ # Model description
7
+
8
+ This model is an openai's whisper-small model fine-tuned on the Kinyarwanda common-voice dataset. The Kinyarwanda language was added by fine-tuning on top of the Swahili language.
9
+ It achieves a 24 WER. Currently, it does not provide Kinyarwanda-to-English translation.
10
+
11
+ # Usage
12
+ ```python
13
+ >>> from transformers import WhisperProcessor, WhisperForConditionalGeneration
14
+ >>> from datasets import load_dataset
15
+ >>> import datasets
16
+ >>> import torch
17
+ >>> # load model and processor
18
+ >>> processor = WhisperProcessor.from_pretrained("mbazaNLP/Whisper-Small-Kinyarwanda")
19
+ >>> model = WhisperForConditionalGeneration.from_pretrained("mbazaNLP/Whisper-Small-Kinyarwanda")
20
+ >>> ds = load_dataset("common_voice", "rw", split="test", streaming=True)
21
+ >>> ds = ds.cast_column("audio", datasets.Audio(sampling_rate=16_000))
22
+ >>> input_speech = next(iter(ds))["audio"]["array"]
23
+ >>> model.config.forced_decoder_ids = processor.get_decoder_prompt_ids(language = "sw", task = "transcribe")
24
+ >>> input_features = processor(input_speech, return_tensors="pt").input_features
25
+ >>> predicted_ids = model.generate(input_features)
26
+ >>> transcription = processor.batch_decode(predicted_ids)
27
+ ['<|startoftranscript|><|sw|><|transcribe|><|notimestamps|>Abamugariye ku rugamba bafashwa kubona insimburangingo<|endoftext|>']
28
+ >>> transcription = processor.batch_decode(predicted_ids, skip_special_tokens = True)
29
+ ['Abamugariye ku rugamba bafashwa kubona insimburangingo']
30
+
31
+ ```