Update model usage instructions
Browse files
README.md
CHANGED
@@ -22,7 +22,7 @@ model-index:
|
|
22 |
metrics:
|
23 |
- name: Normalized CER
|
24 |
type: cer
|
25 |
-
value:
|
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 |
-
|
|
57 |
-
|
|
58 |
-
|
|
59 |
-
|
|
60 |
-
|
|
61 |
-
|
|
62 |
-
|
|
|
|
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> |
|