Update README.md
Browse files
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
|
92 |
|
93 |
-
test_dataset = load_dataset("common_voice", "lg", split="test[:10]")
|
94 |
|
95 |
-
|
96 |
-
|
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
|