英文

Whisper Medium Romanian(低音媒体罗马尼亚语)

这个模型基于Common Voice 11.0数据集和罗马尼亚语音合成语料库对 openai/whisper-medium 进行了微调,模型在评估集上取得了以下结果:

  • eval_loss: 0.06453
  • eval_wer: 4.717
  • epoch: 7.03
  • step: 3500

模型描述

架构与 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 进行了调整。

训练过程

训练超参数

训练时使用了以下超参数:

  • learning_rate: 1e-05
  • train_batch_size: 32
  • eval_batch_size: 32
  • seed: 42
  • optimizer: Adam,betas=(0.9,0.999),epsilon=1e-08
  • lr_scheduler_type: linear
  • lr_scheduler_warmup_steps: 500
  • training_steps: 5000
  • mixed_precision_training: Native AMP

框架版本

  • Transformers 4.26.0.dev0
  • Pytorch 1.13.0+cu117
  • Datasets 2.7.1.dev0
  • Tokenizers 0.13.2