Transformers
Safetensors
Georgian
mbart
text2text-generation
trimmed
lbourdois commited on
Commit
49b4a8c
·
verified ·
1 Parent(s): 9789812

Update model card for Georgian

Browse files
Files changed (1) hide show
  1. README.md +62 -37
README.md CHANGED
@@ -1,37 +1,62 @@
1
- ---
2
- language:
3
- - kat
4
- license: cc-by-nc-4.0
5
- tags: [trimmed, mbart, seq2seq, monolingual, translation]
6
- base_model: facebook/mbart-large-50
7
- datasets:
8
- - Lumberjackk/fineweb-2-trimming
9
- ---
10
-
11
- # mbart-large-50-kat-16384
12
-
13
- Version de [facebook/mbart-large-50](https://huggingface.co/facebook/mbart-large-50) avec vocabulaire réduit
14
- pour **Georgian** (total 16,384 tokens).
15
-
16
- | | Original | Trimmed |
17
- |---|---|---|
18
- | Vocabulaire | 250,027 | 16,384 |
19
- | Paramètres | 610,879,488 | 371,601,408 |
20
-
21
- ## Usage
22
- ```python
23
- from transformers import MBartTokenizerFast, MBartForConditionalGeneration
24
-
25
- tokenizer = MBartTokenizerFast.from_pretrained("lbourdois/mbart-large-50-kat-16384")
26
- model = MBartForConditionalGeneration.from_pretrained("lbourdois/mbart-large-50-kat-16384")
27
-
28
- lang_id = tokenizer.lang_code_to_id["ka_GE"]
29
- model.config.decoder_start_token_id = lang_id
30
- model.generation_config.decoder_start_token_id = lang_id
31
- model.generation_config.forced_bos_token_id = lang_id
32
-
33
- tokenizer.src_lang = "ka_GE"
34
- inputs = tokenizer("Hello world.", return_tensors="pt")
35
- out = model.generate(inputs["input_ids"], forced_bos_token_id=lang_id, max_new_tokens=50)
36
- print(tokenizer.decode(out[0], skip_special_tokens=True))
37
- ```
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language: kat
3
+ license: mit
4
+ tags:
5
+ - trimmed
6
+ library_name: transformers
7
+ base_model: facebook/mbart-large-50
8
+ base_model_relation: quantized
9
+ datasets:
10
+ - lbourdois/fineweb-2-trimming
11
+ ---
12
+
13
+ # mbart-large-50-kat-16384
14
+ This model is a **39.17% smaller** version of [facebook/mbart-large-50](https://huggingface.co/facebook/mbart-large-50) optimized for Georgian language via vocabulary size reduction using the [trimming](https://huggingface.co/blog/lbourdois/introduction-to-trimming) method.
15
+ 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.
16
+
17
+ ## Model Statistics
18
+ | Metric | Original | Trimmed | Reduction |
19
+ |--------|----------|---------|-----------|
20
+ | **Vocabulary size** | 250,027 tokens | 16,384 tokens | **93.45%** |
21
+ | **Model size** | 610,879,488 params | 371,601,408 params | **39.17%** |
22
+
23
+ ![image](https://raw.githubusercontent.com/lbourdois/blog/refs/heads/master/assets/images/Trimming/mbart-large-50-16384.png)
24
+
25
+ ## Mining Dataset Statistics
26
+ - **Number of texts used for mining**: 200,000 texts
27
+ - **Dataset**: [lbourdois/fineweb-2-trimming](https://huggingface.co/datasets/lbourdois/fineweb-2-trimming)
28
+
29
+ ## Usage
30
+
31
+ ```python
32
+ from transformers import AutoModel, AutoTokenizer
33
+
34
+ model_name = "alphaedge-ai/mbart-large-50-kat-16384"
35
+ model = AutoModel.from_pretrained(model_name)
36
+ tokenizer = AutoTokenizer.from_pretrained(model_name)
37
+ ```
38
+
39
+ ## Citations
40
+
41
+ #### mBART
42
+ ```
43
+ @misc{tang2020multilingualtranslationextensiblemultilingual,
44
+ title={Multilingual Translation with Extensible Multilingual Pretraining and Finetuning},
45
+ author={Yuqing Tang and Chau Tran and Xian Li and Peng-Jen Chen and Naman Goyal and Vishrav Chaudhary and Jiatao Gu and Angela Fan},
46
+ year={2020},
47
+ eprint={2008.00401},
48
+ archivePrefix={arXiv},
49
+ primaryClass={cs.CL},
50
+ url={https://arxiv.org/abs/2008.00401},
51
+ }
52
+ ```
53
+
54
+ #### Trimming blog post
55
+ ```
56
+ @misc{hf_blogpost_trimming,
57
+ title={Introduction to Trimming},
58
+ author={Loïck BOURDOIS and Tom AARSEN and Bram VANROY and Christopher AKIKI and Woojun JUNG and Manuel ROMERO and Prithiv SAKTHI},
59
+ year={2026},
60
+ url={https://huggingface.co/blog/lbourdois/introduction-to-trimming},
61
+ }
62
+ ```