File size: 2,326 Bytes
b73b51a
5cb33a8
 
 
b73b51a
 
 
5cb33a8
 
ed543b4
b73b51a
 
 
 
 
 
 
 
5cb33a8
b73b51a
 
 
 
 
5cb33a8
b73b51a
5cb33a8
b73b51a
 
 
 
ed543b4
b73b51a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
ed543b4
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
---
base_model: openai/whisper-small
datasets:
- 1rsh/gujarati-openslr
language:
- gu
license: apache-2.0
metrics:
- wer
- cer
tags:
- hf-asr-leaderboard
- generated_from_trainer
model-index:
- name: Whisper Small Gujarati OpenSLR
  results:
  - task:
      type: automatic-speech-recognition
      name: Automatic Speech Recognition
    dataset:
      name: Gujarati OpenSLR
      type: 1rsh/gujarati-openslr
      args: 'split: train'
    metrics:
    - type: wer
      value: 35.325794291868604
      name: Wer
---

# Whisper Small Gujarati OpenSLR

This model is a fine-tuned version of [vasista22/whisper-gujarati-small](https://huggingface.co/vasista22/whisper-gujarati-small) on the Gujarati OpenSLR dataset.
It achieves the following results on the evaluation set:
- Loss: 0.0472
- Wer: 35.3258
- Cer: 22.3685

## Model description

More information needed

## Intended uses & limitations

More information needed

## Training and evaluation data

More information needed

## Training procedure

### Training hyperparameters

The following hyperparameters were used during training:
- learning_rate: 1e-05
- train_batch_size: 16
- eval_batch_size: 8
- seed: 42
- optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
- lr_scheduler_type: linear
- lr_scheduler_warmup_steps: 500
- num_epochs: 5
- mixed_precision_training: Native AMP

### Training results

| Training Loss | Epoch  | Step | Validation Loss | Wer     | Cer     |
|:-------------:|:------:|:----:|:---------------:|:-------:|:-------:|
| 0.0018        | 4.9505 | 1000 | 0.0472          | 35.3258 | 22.3685 |


### Framework versions

- Transformers 4.41.2
- Pytorch 2.3.0+cu121
- Datasets 2.20.0
- Tokenizers 0.19.1

## Usage

In order to infer a single audio file using this model, the following code snippet can be used:

```python
>>> import torch
>>> from transformers import pipeline

>>> # path to the audio file to be transcribed
>>> audio = "/path/to/audio.format"
>>> device = "cuda:0" if torch.cuda.is_available() else "cpu"

>>> transcribe = pipeline(task="automatic-speech-recognition", model="1rsh/whisper-small-gu", chunk_length_s=30, device=device)
>>> transcribe.model.config.forced_decoder_ids = transcribe.tokenizer.get_decoder_prompt_ids(language="gu", task="transcribe")

>>> print('Transcription: ', transcribe(audio)["text"])
```