readme: ---
  language:
  - th
  license: apache-2.0
  tags:
  - generated_from_trainer
  - whisper-event
  datasets:
  - mozilla-foundation/common_voice_11_0
  metrics:
  - wer
  model-index:
  - name: biodatlab/whisper-medium-th-cmv11
    results:
    - task:
        name: Automatic Speech Recognition
        type: automatic-speech-recognition
      dataset:
        name: Common Voice 11.0
        type: mozilla-foundation/common_voice_11_0
        config: th
        split: test
        args: th
      metrics:
      - name: Wer
        type: wer
        value: 14.37169204589532
  ---
  
  <!-- 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. -->
  
  # Whisper-medium (Thai)
  
  This model is a fine-tuned version of [biodatlab/whisper-medium-th-1000iter](https://huggingface.co/biodatlab/whisper-medium-th-1000iter) on the common_voice_11_0 dataset.
  It achieves the following results on the evaluation set:
  - Loss: 0.2217
  - WER: 14.3717
  - WER (deepcut): 10.2
  
  ## Model description
  
  This is a Whisper model fine-tuned on Commonvoice V11 (Thai language). You can use the model via transformers' `pipeline` as follows:
  
  ```py
  from transformers import pipeline
  
  MODEL_NAME = "biodatlab/whisper-medium-th-cmv11"  # specify the model name
  lang = "th"  # change to Thai langauge
  
  device = 0 if torch.cuda.is_available() else "cpu"
  
  pipe = pipeline(
      task="automatic-speech-recognition",
      model=MODEL_NAME,
      chunk_length_s=30,
      device=device,
  )
  pipe.model.config.forced_decoder_ids = pipe.tokenizer.get_decoder_prompt_ids(
    language=lang,
    task="transcribe"
  )
  text = pipe("audio.mp3")["text"] # give audio mp3 and transcribe 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: 5000
  - mixed_precision_training: Native AMP
  
  ### Training results
  
  | Training Loss | Epoch | Step | Validation Loss | Wer     |
  |:-------------:|:-----:|:----:|:---------------:|:-------:|
  | 0.0001        | 7.31  | 5000 | 0.2217          | 14.3717 |
  
  
  ### Framework versions
  
  - Transformers 4.26.0.dev0
  - Pytorch 1.13.0
  - Datasets 2.7.1
  - Tokenizers 0.13.2
  