
<!-- This model card has been generated automatically according to the information the Trainer had access to. You
should probably proofread and complete it, then remove this comment. -->

# Voice_Cleverlytics_large-v3

This model is a fine-tuned version of [openai/whisper-large-v3](https://huggingface.co/openai/whisper-large-v3) on the Cleverlytics dataset.
It achieves the following results on the evaluation set:
- Loss: 0.0986
- Wer: 90.1933

## Model description

Developed by: Cleverlytics team

## Usage
To run the model, first install the Transformers library through the GitHub repo. 

```python
pip install --upgrade pip
pip install --upgrade git+https://github.com/huggingface/transformers.git accelerate datasets[audio]
```

```python
import torch
from transformers import AutoModelForSpeechSeq2Seq, AutoProcessor, pipeline
#from datasets import load_dataset

device = "cuda:0" if torch.cuda.is_available() else "cpu"
torch_dtype = torch.float16 if torch.cuda.is_available() else torch.float32
model_id = "smerchi/Voice_Cleverlytics_large-v3"

model = AutoModelForSpeechSeq2Seq.from_pretrained(
    model_id, torch_dtype=torch_dtype, low_cpu_mem_usage=False, use_safetensors=True
)
model.to(device)

processor = AutoProcessor.from_pretrained(model_id)

pipe = pipeline(
    "automatic-speech-recognition",
    model=model,
    tokenizer=processor.tokenizer,
    feature_extractor=processor.feature_extractor,
    max_new_tokens=128,
    chunk_length_s=30,
    batch_size=16,
    return_timestamps=True,
    torch_dtype=torch_dtype,
    device=device,
)

audio="/content/audio.mp3"

%time result = pipe(audio)
print(result["text"],)
```

### Training hyperparameters

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

### Training results

| Training Loss | Epoch | Step | Validation Loss | Wer     |
|:-------------:|:-----:|:----:|:---------------:|:-------:|
| 0.6176        | 0.88  | 250  | 0.6065          | 65.3306 |
| 0.2463        | 1.76  | 500  | 0.2433          | 80.4415 |
| 0.059         | 2.64  | 750  | 0.1247          | 74.1928 |
| 0.0095        | 3.52  | 1000 | 0.0986          | 90.1933 |


### Framework versions

- Transformers 4.36.2
- Pytorch 2.0.1+cu117
- Datasets 2.16.0
- Tokenizers 0.15.0

{"license": "apache-2.0", "tags": ["generated_from_trainer"], "metrics": ["wer"], "base_model": "openai/whisper-large-v3", "model-index": [{"name": "Voice_Cleverlytics_large-v3", "results": []}]}
transformers tensorboard safetensors whisper automatic-speech-recognition generated_from_trainer base_model:openai/whisper-large-v3 license:apache-2.0 endpoints_compatible region:us