alvanlii commited on
Commit
34e29e3
1 Parent(s): 309b69d

Update model usage instructions

Browse files
Files changed (1) hide show
  1. README.md +21 -8
README.md CHANGED
@@ -22,7 +22,7 @@ model-index:
22
  metrics:
23
  - name: Normalized CER
24
  type: cer
25
- value: 10.11
26
  ---
27
  <!-- This model card has been generated automatically according to the information the Trainer had access to. You
28
  should probably proofread and complete it, then remove this comment. -->
@@ -31,6 +31,19 @@ should probably proofread and complete it, then remove this comment. -->
31
 
32
  This model is a fine-tuned version of [openai/whisper-large-v2](https://huggingface.co/openai/whisper-large-v2) on the Common Voice 11.0 dataset. This is trained with PEFT LoRA+BNB INT8.
33
 
 
 
 
 
 
 
 
 
 
 
 
 
 
34
  ## Training and evaluation data
35
  For training, three datasets were used:
36
  - Common Voice 11 Canto Train Set
@@ -53,10 +66,10 @@ For training, three datasets were used:
53
 
54
  | Training Loss | Epoch | Step | Validation Loss | Normalized CER |
55
  |:-------------:|:-----:|:----:|:---------------:|:------:|
56
- | 0.4610 | 0.55 | 2000 | 0.3106 | 13.08 |
57
- | 0.3441 | 1.11 | 4000 | 0.2875 | 11.79 |
58
- | 0.3466 | 1.66 | 6000 | 0.2820 | 11.44 |
59
- | 0.2539 | 2.22 | 8000 | 0.2777 | 10.59 |
60
- | 0.2312 | 2.77 | 10000 | 0.2822 | 10.60 |
61
- | 0.1639 | 3.32 | 12000 | 0.2859 | 10.17 |
62
- | 0.1569 | 3.88 | 14000 | 0.2866 | 10
 
22
  metrics:
23
  - name: Normalized CER
24
  type: cer
25
+ value: <TBA>
26
  ---
27
  <!-- This model card has been generated automatically according to the information the Trainer had access to. You
28
  should probably proofread and complete it, then remove this comment. -->
 
31
 
32
  This model is a fine-tuned version of [openai/whisper-large-v2](https://huggingface.co/openai/whisper-large-v2) on the Common Voice 11.0 dataset. This is trained with PEFT LoRA+BNB INT8.
33
 
34
+ To use the model, use the following code. It should be able to inference with less than 16GB VRAM.
35
+ ```
36
+ from peft import PeftModel, PeftConfig
37
+ from transformers import WhisperForConditionalGeneration, Seq2SeqTrainer
38
+
39
+ peft_model_id = "alvanlii/whisper-largev2-cantonese-peft-lora"
40
+ peft_config = PeftConfig.from_pretrained(peft_model_id)
41
+ model = WhisperForConditionalGeneration.from_pretrained(
42
+ peft_config.base_model_name_or_path, load_in_8bit=True, device_map="auto"
43
+ )
44
+ model = PeftModel.from_pretrained(model, peft_model_id)
45
+ ```
46
+
47
  ## Training and evaluation data
48
  For training, three datasets were used:
49
  - Common Voice 11 Canto Train Set
 
66
 
67
  | Training Loss | Epoch | Step | Validation Loss | Normalized CER |
68
  |:-------------:|:-----:|:----:|:---------------:|:------:|
69
+ | <TBA> | 0.55 | 2000 | <TBA> | <TBA> |
70
+ | <TBA> | 1.11 | 4000 | <TBA> | <TBA> |
71
+ | <TBA> | 1.66 | 6000 | <TBA> | <TBA> |
72
+ | <TBA> | 2.22 | 8000 | <TBA> | <TBA> |
73
+ | <TBA> | 2.77 | 10000 | <TBA> | <TBA> |
74
+ | <TBA> | 3.32 | 12000 | <TBA> | <TBA> |
75
+ | <TBA> | 3.88 | 14000 | <TBA> | <TBA> |