wv-shru-v3-s6 published by Kaggle user
qdv206. All credit for training and releasing the original model goes to the original author.
This upload exists to make the checkpoint easier to load and use via the huggingface_hub / transformers ecosystem.hidden_size=1024, checkpoint tag full_shru_v2_s20Wav2Vec2CTCTokenizer + Wav2Vec2FeatureExtractor (Wav2Vec2Processor)Note: the originalconfig.jsonlistsarchitectures: ["Wav2Vec2ForCTCV2"], a custom class name used in the original training pipeline. The underlying weights are a standard Wav2Vec2-for-CTC architecture, so the model loads with the standardWav2Vec2ForCTC/AutoModelForCTCclasses fromtransformers(see usage below).
1import torch
2import soundfile as sf
3from transformers import Wav2Vec2ForCTC, Wav2Vec2Processor
4
5model_id = "SayedShaun/bangla-wave2vec2"
6
7processor = Wav2Vec2Processor.from_pretrained(model_id)
8model = Wav2Vec2ForCTC.from_pretrained(model_id)
9
10speech, sr = sf.read("audio.wav") # expects 16kHz mono
11inputs = processor(speech, sampling_rate=16000, return_tensors="pt", padding=True)
12
13with torch.no_grad():
14 logits = model(inputs.input_values).logits
15
16predicted_ids = torch.argmax(logits, dim=-1)
17transcription = processor.batch_decode(predicted_ids)
18print(transcription)