File size: 525 Bytes
752ce9b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
from utils import hf_login, data, compute_wer
from dataset import Dataset
from model import Model

hf_login()






def run_tests (dataset_choice:str, model:str):

    MoDeL = Model()
    MoDeL.select(model)
    MoDeL.load()
    DaTaSeT = Dataset(100)
    DaTaSeT.load(dataset_choice)
    references, predictions = MoDeL.process(DaTaSeT)
    wer = compute_wer(references=references, predictions=predictions)
    return wer


print("WER:", run_tests(dataset_choice="GigaSpeech", model="facebook/s2t-medium-librispeech-asr"))