ASR_Model_Comparison / test.v01.py
j-tobias
added backend
752ce9b
raw
history blame
525 Bytes
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"))