File size: 1,233 Bytes
806f4a7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
---
library_name: transformers
pipeline_tag: automatic-speech-recognition
tags:
- whisper
- hqq
- quantized
- 4bit
license: apache-2.0
---

# HQQ 4-bit Quantized Whisper Model

This is a 4-bit HQQ quantized version of eolang/whisperturbo.

## Model Details
- **Base Model**: eolang/whisperturbo
- **Quantization**: HQQ 4-bit, group_size=64
- **Compression**: ~4x reduction in size
- **Library**: HQQ (Half-Quadratic Quantization)

## Usage

```python
import torch
from transformers import WhisperProcessor
from hqq.models.hf.base import AutoHQQHFModel
import librosa

# Load quantized model
model = AutoHQQHFModel.from_quantized("eolang/whisper-turbo-hqq-quantized")
processor = WhisperProcessor.from_pretrained("eolang/whisper-turbo-hqq-quantized")

# Load and process audio
audio, sr = librosa.load("audio.wav", sr=16000)
inputs = processor(audio, sampling_rate=16000, return_tensors="pt")

# Generate transcription
with torch.no_grad():
    predicted_ids = model.generate(inputs["input_features"])
    transcription = processor.batch_decode(predicted_ids, skip_special_tokens=True)
    print(transcription[0])
```

## Requirements
- pip install git+https://github.com/mobiusml/hqq.git
- pip install transformers librosa soundfile