[badcase report] observe significant recognition errors on an example of libri_light dataset.

#176
by lawlict - opened

Audio:

Code:

import torch
from transformers import AutoModelForSpeechSeq2Seq, AutoProcessor, pipeline

device = "cuda:0" if torch.cuda.is_available() else "cpu"
torch_dtype = torch.float16 if torch.cuda.is_available() else torch.float32
model_id = "openai/whisper-large-v3"
model = AutoModelForSpeechSeq2Seq.from_pretrained(
    model_id,
    torch_dtype=torch_dtype,
    use_safetensors=True,
    # low_cpu_mem_usage=True,
    # attn_implementation="flash_attention_2", # pip3 install flash-attn --no-build-isolation
)
model.to(device)
processor = AutoProcessor.from_pretrained(model_id)
pipe = pipeline(
    "automatic-speech-recognition",
    model=model,
    tokenizer=processor.tokenizer,
    feature_extractor=processor.feature_extractor,
    torch_dtype=torch_dtype,
    device=device,
)

sample = 'seg30s.wav'
result = pipe(sample)
print(result["text"])

Recognition result:

 XIX.

Sign up or log in to comment