lbourdois commited on
Commit
7ffccbb
·
verified ·
1 Parent(s): 942f506

Update model card for Haitian Creole

Browse files
Files changed (1) hide show
  1. README.md +76 -48
README.md CHANGED
@@ -1,48 +1,76 @@
1
- ---
2
- pipeline_tag: automatic-speech-recognition
3
- language: hat
4
- license: apache-2.0
5
- tags:
6
- - trimmed
7
- - whisper
8
- library_name: transformers
9
- base_model: openai/whisper-tiny
10
- base_model_relation: quantized
11
- ---
12
-
13
- # whisper-tiny-hat-32768
14
-
15
- This model is a vocabulary-pruned version of [openai/whisper-tiny](https://huggingface.co/openai/whisper-tiny)
16
- optimised for **Haitian Creole** via the
17
- [trimming](https://huggingface.co/blog/introduction-to-trimming) method.
18
-
19
- Only the **decoder** token-embedding table and **lm_head** (proj_out) were pruned.
20
- The encoder is **fully unchanged**, so audio feature extraction is identical to
21
- the original model.
22
-
23
- ## Vocabulary reduction
24
-
25
- | Component | Original | Pruned |
26
- |-----------|----------|--------|
27
- | vocab_size | 50258 | 31161 |
28
- | embed_tokens | 19.9M | 12.6M |
29
- | proj_out | 0.0M | 0.0M |
30
- | **Total** | **37.8M** | **30.4M** |
31
-
32
- ## Usage
33
-
34
- ```python
35
- from transformers import WhisperForConditionalGeneration, AutoTokenizer, pipeline
36
-
37
- model = WhisperForConditionalGeneration.from_pretrained("alphaedge-ai/whisper-tiny-hat-32768")
38
- tokenizer = AutoTokenizer.from_pretrained("alphaedge-ai/whisper-tiny-hat-32768")
39
-
40
- asr = pipeline("automatic-speech-recognition", model=model, tokenizer=tokenizer)
41
- result = asr("audio.wav", generate_kwargs={"language": "hat"})
42
- print(result["text"])
43
- ```
44
-
45
- ## ⚠️ Limitations
46
-
47
- Tokens not used in the selected language(s) were removed. The model may produce
48
- incorrect output for other languages.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ pipeline_tag: automatic-speech-recognition
3
+ language: hat
4
+ license: apache-2.0
5
+ tags:
6
+ - trimmed
7
+ library_name: transformers
8
+ base_model: openai/whisper-tiny
9
+ base_model_relation: quantized
10
+ datasets:
11
+ - lbourdois/fineweb-2-trimming
12
+ ---
13
+
14
+ # whisper-tiny-hat-32768
15
+ This model is a **19.42%% smaller** version of [openai/whisper-tiny](https://huggingface.co/openai/whisper-tiny) optimized for **Haitian Creole** language via vocabulary size reduction using the [trimming](https://huggingface.co/blog/lbourdois/introduction-to-trimming) method.
16
+ This trimmed model should perform similarly to the original model with only 32,768 tokens and a much smaller memory footprint. However, it may not perform well for other languages as tokens not commonly used in the selected languages were removed from the vocabulary.
17
+
18
+ ## Model Statistics
19
+ | Metric | Original | Trimmed | Reduction |
20
+ |--------|----------|---------|-----------|
21
+ | **Vocabulary size** | 51,865 tokens | 32,768 tokens | **36.82%** |
22
+ | **Model size** | 37,760,640 params | 30,427,392 params | **19.42%** |
23
+
24
+ ![image](https://raw.githubusercontent.com/lbourdois/blog/refs/heads/master/assets/images/Trimming/whisper-tiny-32768.png)
25
+
26
+ ## Mining Dataset Statistics
27
+ - **Number of texts used for mining**: 200,000 texts
28
+ - **Dataset**: [lbourdois/fineweb-2-trimming](https://huggingface.co/datasets/lbourdois/fineweb-2-trimming)
29
+
30
+ ## Usage
31
+ ```python
32
+ from transformers import AutoModelForSpeechSeq2Seq, AutoProcessor, pipeline
33
+ import librosa
34
+
35
+ # Pipeline function
36
+ processor = AutoProcessor.from_pretrained("alphaedge-ai/whisper-tiny-hat-32768")
37
+ pipe = pipeline(
38
+ "automatic-speech-recognition",
39
+ model="alphaedge-ai/whisper-tiny-hat-32768",
40
+ tokenizer=processor.tokenizer,
41
+ feature_extractor=processor.feature_extractor,
42
+ generate_kwargs={"language": "haitian creole", "task": "transcribe"},
43
+ )
44
+
45
+ # Loading and resampling at 16 kHz (required by Whisper)
46
+ audio_array, sampling_rate = librosa.load(audio_path, sr=16000)
47
+
48
+ # Result
49
+ result = pipe(audio_array)
50
+ print("Transcription :", result["text"])
51
+ ```
52
+
53
+ ## Citations
54
+
55
+ #### Whisper
56
+ ```
57
+ @misc{radford2022whisper,
58
+ doi = {10.48550/ARXIV.2212.04356},
59
+ url = {https://arxiv.org/abs/2212.04356},
60
+ author = {Radford, Alec and Kim, Jong Wook and Xu, Tao and Brockman, Greg and McLeavey, Christine and Sutskever, Ilya},
61
+ title = {Robust Speech Recognition via Large-Scale Weak Supervision},
62
+ publisher = {arXiv},
63
+ year = {2022},
64
+ copyright = {arXiv.org perpetual, non-exclusive license}
65
+ }
66
+ ```
67
+
68
+ #### Trimming blog post
69
+ ```
70
+ @misc{hf_blogpost_trimming,
71
+ title={Introduction to Trimming},
72
+ author={Loïck BOURDOIS and Tom AARSEN and Bram VANROY and Christopher AKIKI and Woojun JUNG and Manuel ROMERO and Prithiv SAKTHI},
73
+ year={2026},
74
+ url={https://huggingface.co/blog/lbourdois/introduction-to-trimming},
75
+ }
76
+ ```