UmarRamzan commited on
Commit
5e3ddd2
1 Parent(s): 56b6925

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +17 -7
README.md CHANGED
@@ -15,24 +15,34 @@ language:
15
  <!-- This model card has been generated automatically according to the information the Trainer had access to. You
16
  should probably proofread and complete it, then remove this comment. -->
17
 
18
- # w2v2-bert-urdu
19
 
20
- This model is a fine-tuned version of [UmarRamzan/w2v2-bert-urdu](https://huggingface.co/UmarRamzan/w2v2-bert-urdu) on an unknown dataset.
21
  It achieves the following results on the evaluation set:
22
  - Loss: 0.3681
23
  - Wer: 0.2929
24
 
25
  ## Model description
26
 
27
- More information needed
28
 
29
- ## Intended uses & limitations
 
 
 
30
 
31
- More information needed
 
 
32
 
33
- ## Training and evaluation data
 
34
 
35
- More information needed
 
 
 
 
36
 
37
  ## Training procedure
38
 
 
15
  <!-- This model card has been generated automatically according to the information the Trainer had access to. You
16
  should probably proofread and complete it, then remove this comment. -->
17
 
18
+ # Wav2Vec-Bert-2.0-Urdu
19
 
20
+ This model is a fine-tuned version of [facebook/w2v-bert-2.0](https://huggingface.co/facebook/w2v-bert-2.0) on the Urdu split of the [Common Voice 17](https://huggingface.co/datasets/mozilla-foundation/common_voice_17_0) dataset.
21
  It achieves the following results on the evaluation set:
22
  - Loss: 0.3681
23
  - Wer: 0.2929
24
 
25
  ## Model description
26
 
27
+ ## Usage Instructions
28
 
29
+ ```python
30
+ from transformers import AutoFeatureExtractor, Wav2Vec2BertModel
31
+ import torch
32
+ from datasets import load_dataset
33
 
34
+ dataset = load_dataset("hf-internal-testing/librispeech_asr_demo", "clean", split="validation")
35
+ dataset = dataset.sort("id")
36
+ sampling_rate = dataset.features["audio"].sampling_rate
37
 
38
+ processor = AutoProcessor.from_pretrained("UmarRamzan/w2v2-bert-urdu")
39
+ model = Wav2Vec2BertModel.from_pretrained("UmarRamzan/w2v2-bert-urdu")
40
 
41
+ # audio file is decoded on the fly
42
+ inputs = processor(dataset[0]["audio"]["array"], sampling_rate=sampling_rate, return_tensors="pt")
43
+ with torch.no_grad():
44
+ outputs = model(**inputs)
45
+ ```
46
 
47
  ## Training procedure
48