模型:
imvladikon/wav2vec2-xls-r-300m-lm-hebrew
This model is a fine-tuned version of facebook/wav2vec2-xls-r-300m on the None dataset with adding ngram models according to Boosting Wav2Vec2 with n-grams in ? Transformers
check package: https://github.com/imvladikon/wav2vec2-hebrew
or use transformers pipeline:
import torch from datasets import load_dataset from transformers import AutoModelForCTC, AutoProcessor import torchaudio.functional as F model_id = "imvladikon/wav2vec2-xls-r-300m-lm-hebrew" sample_iter = iter(load_dataset("google/fleurs", "he_il", split="test", streaming=True)) sample = next(sample_iter) resampled_audio = F.resample(torch.tensor(sample["audio"]["array"]), sample["audio"]["sampling_rate"], 16_000).numpy() model = AutoModelForCTC.from_pretrained(model_id) processor = AutoProcessor.from_pretrained(model_id) input_values = processor(resampled_audio, return_tensors="pt").input_values with torch.no_grad(): logits = model(input_values).logits transcription = processor.batch_decode(logits.numpy()).text print(transcription)
More information needed
More information needed
The following hyperparameters were used during training: