dmusingu commited on
Commit
ad21e49
1 Parent(s): f3ce2c7

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +6 -4
README.md CHANGED
@@ -88,12 +88,12 @@ The following hyperparameters were used during training:
88
  import torch
89
  import torchaudio
90
  from datasets import load_dataset
91
- from transformers import Wav2Vec2ForCTC, Wav2Vec2Processor
92
 
93
- test_dataset = load_dataset("common_voice", "lg", split="test[:10]")
94
 
95
- processor = Wav2Vec2Processor.from_pretrained("dmusingu/w2v-bert-2.0-luganda-CV-train-validation-7.0")
96
- model = Wav2Vec2ForCTC.from_pretrained("dmusingu/w2v-bert-2.0-luganda-CV-train-validation-7.0")
97
 
98
  resampler = torchaudio.transforms.Resample(48_000, 16_000)
99
 
@@ -115,3 +115,5 @@ predicted_ids = torch.argmax(logits, dim=-1)
115
  print("Prediction:", processor.batch_decode(predicted_ids))
116
  print("Reference:", test_dataset["sentence"][:2])
117
  ```
 
 
 
88
  import torch
89
  import torchaudio
90
  from datasets import load_dataset
91
+ from transformers import AutoModelForCTC, Wav2Vec2BertProcessor
92
 
93
+ test_dataset = load_dataset("common_voice", "lg", split="test[:10]")
94
 
95
+ model = AutoModelForCTC.from_pretrained("dmusingu/w2v-bert-2.0-luganda-CV-train-validation-7.0")
96
+ processor = Wav2Vec2BertProcessor.from_pretrained("dmusingu/w2v-bert-2.0-luganda-CV-train-validation-7.0")
97
 
98
  resampler = torchaudio.transforms.Resample(48_000, 16_000)
99
 
 
115
  print("Prediction:", processor.batch_decode(predicted_ids))
116
  print("Reference:", test_dataset["sentence"][:2])
117
  ```
118
+
119
+ ### Evaluation