Downloads · 30 days
2
13% of all-time downloads
jxue/whisper-small-jiangyin-lora
whisper-small-jiangyin-lora is a machine learning model from jxue. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for peft.
This is a LoRA adapter for openai/whisper-small fine-tuned on Jiangyin dialect from WuSutra.com. Wusutra.com is a dialect crowdsourcing website which implements the entire ML workflow — including audio upload, model t…
Downloads · 30 days
2
13% of all-time downloads
All-time downloads
16
Public
Repo size
52.1 MB
Likes
1
Public
Click a slice to open those files.
.safetensors22.5 MB · 79%
From the Hugging Face model README
This is a LoRA adapter for openai/whisper-small fine-tuned on Jiangyin dialect from WuSutra.com.
Wusutra.com is a dialect crowdsourcing website which implements the entire ML workflow — including audio upload, model training, validation, and inference.
You can upload your own audios and even trigger the training yourself on wusutra.com. If you have further questions, feel free to message me.
import torch
from transformers import WhisperForConditionalGeneration, WhisperProcessor
from peft import PeftModel
# Load base model
model = WhisperForConditionalGeneration.from_pretrained("openai/whisper-small")
processor = WhisperProcessor.from_pretrained("openai/whisper-small")
# Load LoRA adapter
model = PeftModel.from_pretrained(model, "jxue/whisper_small_jiangyin_lora")
# Transcribe audio
with torch.no_grad():
input_features = processor(
audio_array, sampling_rate=16000, return_tensors="pt"
).input_features.to(device)
predicted_ids = model.generate(
input_features=input_features,
forced_decoder_ids=processor.get_decoder_prompt_ids(language="zh", task="transcribe")
)
transcription = processor.batch_decode(predicted_ids, skip_special_tokens=True)