模型:
imvladikon/wav2vec2-xls-r-300m-lm-hebrew
该模型是在“数据集未知”上通过添加ngram模型对 facebook/wav2vec2-xls-r-300m 进行微调的版本,根据 Boosting Wav2Vec2 with n-grams in ? Transformers 进行了调整。
请检查软件包: https://github.com/imvladikon/wav2vec2-hebrew
或使用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)
需要更多信息。
需要更多信息。
训练时使用了以下超参数: