Downloads · 30 days
44
2% of all-time downloads
waveletdeboshir/gigaam-v3-ctc-with-lm
gigaam-v3-ctc-with-lm is a automatic speech recognition model from waveletdeboshir. Use it when you need speech turned into text. It is set up for transformers. The card lists the license as mit.
This is an unofficial Transformers wrapper for the original GigaAM model released by SberDevices.
Downloads · 30 days
44
2% of all-time downloads
All-time downloads
2K
Public
Parameters
221M
3.1 GB on disk
Likes
3
Public
Click a slice to open those files.
.bin2.6 GB · 85%
How the weights are stored.
F16221M · 100%
From the Hugging Face model README
This is an unofficial Transformers wrapper for the original GigaAM model released by SberDevices.
bond005/wav2vec2-large-ru-golos-with-lmRussian ASR model GigaAM-v3-CTC with external ngram LM and beamsearch decoding.
my lib versions:
torch 2.8.0torchaudio 2.8.0transformers 4.49.0You need to install kenlm and pyctcdecode:
pip install kenlm
pip install pyctcdecode
from transformers import AutoModel, AutoProcessor
import torch
import torchaudio
# load audio
wav, sr = torchaudio.load("audio.wav")
# resample if necessary
wav = torchaudio.functional.resample(wav, sr, 16000)
# load model and processor
processor = AutoProcessor.from_pretrained("waveletdeboshir/gigaam-v3-ctc-with-lm", trust_remote_code=True)
model = AutoModel.from_pretrained("waveletdeboshir/gigaam-v3-ctc-with-lm", trust_remote_code=True)
model.eval()
input_features = processor(wav[0], sampling_rate=16000, return_tensors="pt")
# predict
with torch.no_grad():
logits = model(**input_features).logits
# decoding with beamseach and LM (tune alpha, beta, beam_width for your data)
transcription = processor.batch_decode(
logits=logits.numpy(),
beam_width=64,
alpha=0.5,
beta=0.5,
).text[0]
We can use decoder to extract word-level timestamps. For this we need to know model stride and set parameter output_word_offsets=True.
In our case (Conformer) MODEL_STRIDE = 40 ms per timestamp.
MODEL_STRIDE = 40
outputs = processor.batch_decode(
logits=logits.numpy(),
beam_width=64,
alpha=0.5,
beta=0.5,
output_word_offsets=True
)
word_ts = [
{
"word": d["word"],
"start": round(d["start_offset"] * MODEL_STRIDE / 1000, 2),
"end": round(d["end_offset"] * MODEL_STRIDE / 1000, 2),
}
for d in outputs.word_offsets[0]
]