pablo-rf commited on
Commit
3a562ab
·
verified ·
1 Parent(s): 288670d

Update README_en

Browse files
Files changed (1) hide show
  1. README.md +166 -1
README.md CHANGED
@@ -1,3 +1,168 @@
1
  ---
2
- license: mit
 
 
 
 
 
 
 
3
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
+ language:
3
+ - gl
4
+ licence:
5
+ - mit
6
+ tags:
7
+ - galician
8
+ - FLOR
9
+ - bloom
10
  ---
11
+
12
+ # FLOR-1.3B-GL
13
+
14
+ ## Table of Contents
15
+ <details>
16
+ <summary>Click to expand</summary>
17
+
18
+ - [FLOR-1.3B-GL](#flor-13b-gl)
19
+ - [Table of Contents](#table-of-contents)
20
+ - [Model description](#model-description)
21
+ - [Intended uses and limitations](#intended-uses-and-limitations)
22
+ - [How to use](#how-to-use)
23
+ - [Training](#training)
24
+ - [Platform](#platform)
25
+ - [Language adaptation and training](#language-adaptation-and-training)
26
+ - [Training data](#training-data)
27
+ - [Training hyperparameters](#training-hyperparameters)
28
+ - [Framework](#framework)
29
+ - [Evaluation](#evaluation)
30
+ - [Additional information](#additional-information)
31
+ - [Author](#author)
32
+ - [Contact](#contact)
33
+ - [Copyright](#copyright)
34
+ - [License](#license)
35
+ - [Funding](#funding)
36
+ - [Disclaimer](#disclaimer)
37
+
38
+ </details>
39
+
40
+ ## Model description
41
+
42
+ **FLOR-1.3B-GL** is a 1.3B-parameter transformer-based causal language model for Galician.
43
+ It is the result of continual pretraining of [FLOR-1.3B](https://huggingface.co/projecte-aina/FLOR-1.3B) with the galician corpus [CorpusNos]().
44
+
45
+ ## Intended uses and limitations
46
+
47
+ The **FLOR-1.3B-GL** model is ready-to-use only for causal language modeling.
48
+ It can perform text-generation tasks and be fine-tuned for specific scenarios.
49
+
50
+ ## How to use
51
+ ```python
52
+ import torch
53
+ from transformers import pipeline, AutoTokenizer, AutoModelForCausalLM
54
+
55
+ input_text = "Hoxe fai un bo día. O sol brilla con forza no ceo, e "
56
+
57
+ model_id = "proxectonos/FLOR-1.3B-GL"
58
+ tokenizer = AutoTokenizer.from_pretrained(model_id)
59
+ generator = pipeline(
60
+ "text-generation",
61
+ model=model_id,
62
+ tokenizer=tokenizer,
63
+ torch_dtype=torch.bfloat16,
64
+ trust_remote_code=True,
65
+ device_map="auto",
66
+ )
67
+ generation = generator(
68
+ input_text,
69
+ do_sample=True,
70
+ top_k=10,
71
+ eos_token_id=tokenizer.eos_token_id,
72
+ )
73
+
74
+ print(f"Result: {generation[0]['generated_text']}")
75
+ ```
76
+
77
+ ## Training
78
+
79
+ ### Platform
80
+
81
+ HF Tranformers + run_clm.py
82
+
83
+ ### Language adaptation and training
84
+
85
+ The language adaptation technique used to train FLOR-1.3B-GL is based in the used to train FLOR-1.3B, which is explanied by their authors in this [Medium Post](https://medium.com/@mpamies247/flor-6-3b-a-chinchilla-compliant-model-for-catalan-spanish-and-english-7cdb389a9aac). In summary, we proceeded as follows:
86
+ 1) We trained our own BPE tokenizer for galician and replaced the original FLOR-1.3B tokenizer and vocabulary with it.
87
+ 2) The embeddings corresponding to tokens that are present in both the original and the target vocabulary (matching tokens) were used for initialization.
88
+ 3) The embeddings from tokens not present in FLOR-1.3-GL's original vocabulary were initialized as the average of all embeddings.
89
+ 4) The model was initialized with the weights from FLOR-1.3B and with our adapted tokenizer (step 1) and embeddings (steps 2-3).
90
+ 5) The model was then trained on a galician corpus.
91
+
92
+ ### Training data
93
+
94
+ The training corpus is the same that was used to train [Ǎguila-7B](https://huggingface.co/projecte-aina/aguila-7b).
95
+ It consists of 26B tokens of several corpora gathered from web crawlings and public domain data.
96
+
97
+ | Dataset | Language | Words (per-epoch) | Epochs |
98
+ |---------------------|----------|--------------------|--------------|
99
+ | Wikipedia | en | 2169.97M | 1.428144485 |
100
+ | C4_es | es | 53709.80M | 0.1049686196 |
101
+ | Biomedical | es | 455.03M | 0.7140722425 |
102
+ | Legal | es | 995.70M | 0.7140722425 |
103
+ | Wikipedia | es | 693.60M | 1.428144485 |
104
+ | Gutenberg | es | 53.18M | 0.7140722425 |
105
+ | C4_ca | ca | 2826.00M | 2.142216727 |
106
+ | Biomedical | ca | 11.80M | 1.428144485 |
107
+ | RacoCatalà Noticias | ca | 17.16M | 2.142216727 |
108
+ | RacoCatalà Forums | ca | 333.73M | 2.142216727 |
109
+ | CaWaC | ca | 57.79M | 2.142216727 |
110
+ | Wikipedia | ca | 228.01M | 3.570361212 |
111
+ | Vilaweb | ca | 50.34M | 2.142216727 |
112
+
113
+
114
+ ### Training hyperparameters
115
+
116
+ - seed: 42
117
+ - num_devices: 1
118
+ - train_batch_size: 2
119
+ - eval_batch_size: 2
120
+ - gradient_acummulation: 4
121
+ - optimizer: AdamW
122
+ - betas: (0.9,0.999)
123
+ - epsilon: 1e-08
124
+ - weight_decay_rate: 0.1
125
+ - scheduler: "Linear"
126
+ - learning_rate: 5e-05
127
+ - num_epochs: 1.2
128
+ -
129
+ ### Framework
130
+ CESGA, 1 node with 5GPUs A100
131
+
132
+ ## Evaluation
133
+ |
134
+
135
+ ## Additional information
136
+
137
+ ### Author
138
+ The Language Technologies Unit from Barcelona Supercomputing Center.
139
+
140
+ ### Contact
141
+ For further information, please send an email to <[email protected]>.
142
+
143
+ ### Copyright
144
+ Copyright(c) 2023 by Language Technologies Unit, Barcelona Supercomputing Center.
145
+
146
+ ### License
147
+ [MIT]()
148
+
149
+ ### Funding
150
+ This research was funded by “The Nós project: Galician in the society and economy of Artificial Intelligence”, resulting from the agreement 2021-CP080 between the Xunta de Galicia and the University of Santiago de Compostela, and thanks to the Investigo program, within the National Recovery, Transformation and Resilience Plan, within the framework of the European Recovery Fund (NextGenerationEU).
151
+
152
+ ### Disclaimer
153
+
154
+ <details>
155
+ <summary>Click to expand</summary>
156
+
157
+ The model published in this repository is intended for a generalist purpose and is available to third parties under a permissive Apache License, Version 2.0.
158
+
159
+ Be aware that the model may have biases and/or any other undesirable distortions.
160
+
161
+ When third parties deploy or provide systems and/or services to other parties using this model (or any system based on it)
162
+ or become users of the model, they should note that it is their responsibility to mitigate the risks arising from its use and,
163
+ in any event, to comply with applicable regulations, including regulations regarding the use of Artificial Intelligence.
164
+
165
+ In no event shall the owner and creator of the model (Barcelona Supercomputing Center)
166
+ be liable for any results arising from the use made by third parties.
167
+
168
+ </details>