Merge branch 'main' of https://huggingface.co/ctl/wav2vec2-large-xlsr-cantonese into main
Browse files
README.md
CHANGED
@@ -79,6 +79,7 @@ The model can be evaluated as follows on the {language} test data of Common Voic
|
|
79 |
```python
|
80 |
!mkdir cer
|
81 |
!wget -O cer/cer.py https://huggingface.co/ctl/wav2vec2-large-xlsr-cantonese/raw/main/cer.py
|
|
|
82 |
import torch
|
83 |
import torchaudio
|
84 |
from datasets import load_dataset, load_metric
|
@@ -95,7 +96,7 @@ test_dataset = load_dataset("common_voice", f"{lang_id}", split="test")
|
|
95 |
cer = load_metric("./cer")
|
96 |
|
97 |
processor = Wav2Vec2Processor.from_pretrained(f"{model_id}")
|
98 |
-
model = Wav2Vec2ForCTC.from_pretrained(f"{
|
99 |
model.to("cuda")
|
100 |
|
101 |
resampler = torchaudio.transforms.Resample(48_000, 16_000)
|
|
|
79 |
```python
|
80 |
!mkdir cer
|
81 |
!wget -O cer/cer.py https://huggingface.co/ctl/wav2vec2-large-xlsr-cantonese/raw/main/cer.py
|
82 |
+
!pip install jiwer
|
83 |
import torch
|
84 |
import torchaudio
|
85 |
from datasets import load_dataset, load_metric
|
|
|
96 |
cer = load_metric("./cer")
|
97 |
|
98 |
processor = Wav2Vec2Processor.from_pretrained(f"{model_id}")
|
99 |
+
model = Wav2Vec2ForCTC.from_pretrained(f"{model_id}")
|
100 |
model.to("cuda")
|
101 |
|
102 |
resampler = torchaudio.transforms.Resample(48_000, 16_000)
|