模型:
gigant/whisper-medium-romanian
这个模型基于Common Voice 11.0数据集和罗马尼亚语音合成语料库对 openai/whisper-medium 进行了微调,模型在评估集上取得了以下结果:
架构与 openai/whisper-medium 相同。
模型在Common Voice 11.0数据集(train+validation+其他分割)和罗马尼亚语音合成语料库上进行了训练,并在Common Voice 11.0数据集的测试分割上进行了测试。
使用? transformers进行推理
from transformers import WhisperProcessor, WhisperForConditionalGeneration from datasets import Audio, load_dataset import torch # load model and processor processor = WhisperProcessor.from_pretrained("gigant/whisper-medium-romanian") model = WhisperForConditionalGeneration.from_pretrained("gigant/whisper-medium-romanian") # load dummy dataset and read soundfiles ds = load_dataset("common_voice", "ro", split="test", streaming=True) ds = ds.cast_column("audio", Audio(sampling_rate=16_000)) input_speech = next(iter(ds))["audio"]["array"] model.config.forced_decoder_ids = processor.get_decoder_prompt_ids(language = "ro", task = "transcribe") input_features = processor(input_speech, return_tensors="pt", sampling_rate=16_000).input_features predicted_ids = model.generate(input_features, max_length=448) # transcription = processor.batch_decode(predicted_ids) transcription = processor.batch_decode(predicted_ids, skip_special_tokens = True)
代码由 openai/whisper-medium 进行了调整。
训练时使用了以下超参数: