Downloads · 30 days
31.7K
91% of all-time downloads
Yehor/whisper-large-v3-turbo-quantized-uk
whisper-large-v3-turbo-quantized-uk is a machine learning model from Yehor. Use it for the machine learning task on the model card, and read the license before you ship it in a product. The card lists the license as apache-2.0.
Quantized it using https://pypi.org/project/llmcompressor/
Downloads · 30 days
31.7K
91% of all-time downloads
All-time downloads
34.8K
Public
Parameters
882M
1.1 GB on disk
Likes
5
Public
Click a slice to open those files.
.safetensors563 MB · 100%
How the weights are stored.
I32800M · 91%
From the Hugging Face model README
Quantized it using https://pypi.org/project/llmcompressor/
Data used for calibration: https://huggingface.co/datasets/Yehor/cv10-uk-testset-clean-punctuated
How to quantize: https://colab.research.google.com/drive/1TsCMxwq9kqsWV8jabihFN7J78RKgyvnD?usp=sharing
Install required packages:
pip install vllm polars
Run inference:
import io
import wave
import numpy as np
import polars as pl
from vllm import LLM, SamplingParams
def bytes_to_numpy(_bytes):
with wave.open(io.BytesIO(_bytes), "rb") as wr:
if (nc := wr.getnchannels()) != 1:
raise ValueError(f"num_channels must be 1, got {nc}")
if (sw := wr.getsampwidth()) != 2:
raise ValueError(f"sample_width must be 2, got {sw}")
audio_data = wr.readframes(wr.getnframes())
return np.frombuffer(audio_data, dtype=np.int16).astype(np.float32) / 32768.0
llm = LLM(
model="Yehor/whisper-large-v3-turbo-quantized-uk",
max_model_len=448,
max_num_seqs=400,
gpu_memory_utilization=0.8,
limit_mm_per_prompt={"audio": 1},
)
df = pl.read_parquet("hf://datasets/Yehor/cv10-uk-testset-clean/data/train-*.parquet")
for row in df.iter_rows(named=True):
inputs = {
"encoder_prompt": {
"prompt": "",
"multi_modal_data": {
"audio": (bytes_to_numpy(row["audio"]["bytes"]), 16_000,),
},
},
"decoder_prompt": "<|startoftranscript|><|uk|><|transcribe|><|notimestamps|>",
}
sampling_params = SamplingParams(
temperature=1.0,
top_p=1.0,
max_tokens=200,
)
outputs = llm.generate(inputs, sampling_params)
print(f"PROMPT : {outputs[0].prompt}")
print(f"TRANSCRIPTION: {row['transcription']}")
print(f"PREDICTION: {outputs[0].outputs[0].text}")
print("==========================================")