lbourdoispro commited on
Commit
585a846
·
verified ·
1 Parent(s): dd0ca1a

Use ISO 639-1 language codes when available

Browse files
Files changed (1) hide show
  1. README.md +75 -75
README.md CHANGED
@@ -1,76 +1,76 @@
1
- ---
2
- pipeline_tag: automatic-speech-recognition
3
- language: ltz
4
- license: apache-2.0
5
- tags:
6
- - trimmed
7
- library_name: transformers
8
- base_model: openai/whisper-medium
9
- base_model_relation: quantized
10
- datasets:
11
- - lbourdois/fineweb-2-trimming
12
- ---
13
-
14
- # whisper-medium-ltz-16384
15
- This model is a **4.76% medium** version of [openai/whisper-medium](https://huggingface.co/openai/whisper-medium) optimized for **Luxembourgish** 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 16,384 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 | 16,384 tokens | **68.41%** |
22
- | **Model size** | 763,857,920 params | 727,525,376 params | **4.76%** |
23
-
24
- ![image](https://raw.githubusercontent.com/lbourdois/blog/refs/heads/master/assets/images/Trimming/whisper-medium-16384.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-medium-ltz-16384")
37
- pipe = pipeline(
38
- "automatic-speech-recognition",
39
- model="alphaedge-ai/whisper-medium-ltz-16384",
40
- tokenizer=processor.tokenizer,
41
- feature_extractor=processor.feature_extractor,
42
- generate_kwargs={"language": "luxembourgish", "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
  ```
 
1
+ ---
2
+ pipeline_tag: automatic-speech-recognition
3
+ language: lb
4
+ license: apache-2.0
5
+ tags:
6
+ - trimmed
7
+ library_name: transformers
8
+ base_model: openai/whisper-medium
9
+ base_model_relation: quantized
10
+ datasets:
11
+ - lbourdois/fineweb-2-trimming
12
+ ---
13
+
14
+ # whisper-medium-ltz-16384
15
+ This model is a **4.76% medium** version of [openai/whisper-medium](https://huggingface.co/openai/whisper-medium) optimized for **Luxembourgish** 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 16,384 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 | 16,384 tokens | **68.41%** |
22
+ | **Model size** | 763,857,920 params | 727,525,376 params | **4.76%** |
23
+
24
+ ![image](https://raw.githubusercontent.com/lbourdois/blog/refs/heads/master/assets/images/Trimming/whisper-medium-16384.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-medium-ltz-16384")
37
+ pipe = pipeline(
38
+ "automatic-speech-recognition",
39
+ model="alphaedge-ai/whisper-medium-ltz-16384",
40
+ tokenizer=processor.tokenizer,
41
+ feature_extractor=processor.feature_extractor,
42
+ generate_kwargs={"language": "luxembourgish", "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
  ```