Update README
Browse files
README.md
CHANGED
|
@@ -25,193 +25,8 @@ widget:
|
|
| 25 |
# top_p: 1.0
|
| 26 |
# top_k: null
|
| 27 |
# max_new_tokens: null
|
|
|
|
|
|
|
|
|
|
|
|
|
| 28 |
---
|
| 29 |
-
|
| 30 |
-
# Model Card for Lucie-7B
|
| 31 |
-
|
| 32 |
-
<!-- inspired from the following template:
|
| 33 |
-
https://github.com/huggingface/huggingface_hub/blob/main/src/huggingface_hub/templates/modelcard_template.md?plain=1
|
| 34 |
-
-->
|
| 35 |
-
|
| 36 |
-
* [Model Description](#model-description)
|
| 37 |
-
<!-- * [Uses](#uses) -->
|
| 38 |
-
* [Example code in python](#example-code-in-python)
|
| 39 |
-
* [Sentence completion](#sentence-completion)
|
| 40 |
-
* [Load a checkpoint](#load-a-checkpoint)
|
| 41 |
-
* [Training Details](#training-details)
|
| 42 |
-
* [Training Data](#training-data)
|
| 43 |
-
* [Training Procedure](#training-procedure)
|
| 44 |
-
<!-- * [Evaluation](#evaluation) -->
|
| 45 |
-
* [Acknowledgements](#acknowledgements)
|
| 46 |
-
* [Contact](#contact)
|
| 47 |
-
|
| 48 |
-
## Model Description
|
| 49 |
-
|
| 50 |
-
Lucie-7B is a pretrained 7B parameter causal language model built by [LINAGORA](https://labs.linagora.com/) and [OpenLLM-France](https://github.com/OpenLLM-France),
|
| 51 |
-
available under the [Apache 2.0 license](https://www.apache.org/licenses/LICENSE-2.0).
|
| 52 |
-
|
| 53 |
-
Lucie-7B was trained on 3 trillion tokens of multilingual data, including
|
| 54 |
-
English (33.2%),
|
| 55 |
-
French (32.4%),
|
| 56 |
-
German (6.9%),
|
| 57 |
-
Spanish (6.6%),
|
| 58 |
-
Italian (3.8%),
|
| 59 |
-
and parallel data from those languages (2.5%),
|
| 60 |
-
as well as several programming languages (14.7%).
|
| 61 |
-
|
| 62 |
-
## Example code in python
|
| 63 |
-
|
| 64 |
-
### Sentence completion
|
| 65 |
-
|
| 66 |
-
Load the model (quantized version on GPU if possible, for efficient inference):
|
| 67 |
-
```python
|
| 68 |
-
import transformers
|
| 69 |
-
|
| 70 |
-
model_name = "OpenLLM-France/Lucie-7B"
|
| 71 |
-
|
| 72 |
-
tokenizer = transformers.AutoTokenizer.from_pretrained(model_name)
|
| 73 |
-
model = transformers.AutoModelForCausalLM.from_pretrained(model_name,
|
| 74 |
-
device_map="auto",
|
| 75 |
-
load_in_4bit=True # For efficient inference, if quantization is supported by the GPU card
|
| 76 |
-
)
|
| 77 |
-
```
|
| 78 |
-
|
| 79 |
-
Wrap the model in a text generation pipeline, and prepare some generation parameters:
|
| 80 |
-
```
|
| 81 |
-
pipeline = transformers.pipeline("text-generation", model=model, tokenizer=tokenizer)
|
| 82 |
-
|
| 83 |
-
generation_kwargs = dict(
|
| 84 |
-
num_return_sequences=1, # Number of variants to generate.
|
| 85 |
-
return_full_text= False, # Do not include the prompt in the generated text.
|
| 86 |
-
do_sample=True,
|
| 87 |
-
temperature=1.0, top_p=1, top_k=None, # Sampling parameters.
|
| 88 |
-
max_new_tokens=200, # Maximum length for the output text (in number of tokens).
|
| 89 |
-
)
|
| 90 |
-
```
|
| 91 |
-
|
| 92 |
-
Try 1-shot question answering:
|
| 93 |
-
```python
|
| 94 |
-
prompt = """\
|
| 95 |
-
Quelle est la capitale de l'Espagne ? Madrid\n\
|
| 96 |
-
Quelle est la capitale de la France ?\
|
| 97 |
-
"""
|
| 98 |
-
completions = pipeline(prompt, **generation_kwargs)
|
| 99 |
-
for completion in completions:
|
| 100 |
-
print(prompt + " […]" + completion['generated_text'])
|
| 101 |
-
```
|
| 102 |
-
This will print something like:
|
| 103 |
-
```
|
| 104 |
-
Quelle est la capitale de l'Espagne ? Madrid
|
| 105 |
-
Quelle est la capitale de la France ? […] Paris
|
| 106 |
-
Quelle est la capitale de l'Italie? Rome
|
| 107 |
-
Quelle est la capitale de la Grande-Bretagne? Londres
|
| 108 |
-
Quelle est la capitale de la Suisse? Berne
|
| 109 |
-
Quelle est la capitale du Portugal? Lisbonne
|
| 110 |
-
Quelle est la capitale de l'Algérie? Alger
|
| 111 |
-
...
|
| 112 |
-
```
|
| 113 |
-
|
| 114 |
-
If running on GPU (`cuda` device), you will need at least 6GB of VRAM to run inference using 4bit quantization (16GB of VRAM without 4bit quantization).
|
| 115 |
-
|
| 116 |
-
### Load a checkpoint
|
| 117 |
-
|
| 118 |
-
Checkpoints at several training steps are available under revision tags,
|
| 119 |
-
every 5000 steps during the first 25000 steps, and then every 25000 steps.
|
| 120 |
-
|
| 121 |
-
Intermediate checkpoints can be loaded using the `revision` parameter:
|
| 122 |
-
```python
|
| 123 |
-
model = transformers.AutoModelForCausalLM.from_pretrained(model_name,
|
| 124 |
-
revision="step0400000",
|
| 125 |
-
...
|
| 126 |
-
)
|
| 127 |
-
```
|
| 128 |
-
where `revision` can be one of:
|
| 129 |
-
* ["`step0005000`"](https://huggingface.co/OpenLLM-France/Lucie-7B/tree/step0005000), ["`step0010000`"](https://huggingface.co/OpenLLM-France/Lucie-7B/tree/step0010000), ["`step0015000`"](https://huggingface.co/OpenLLM-France/Lucie-7B/tree/step0015000), ["`step0020000`"](https://huggingface.co/OpenLLM-France/Lucie-7B/tree/step0020000): each 5000 steps for the first pre-training steps.
|
| 130 |
-
* ["`step0025000`"](https://huggingface.co/OpenLLM-France/Lucie-7B/tree/step0025000), ["`step0050000`"](https://huggingface.co/OpenLLM-France/Lucie-7B/tree/step0050000), ["`step0075000`"](https://huggingface.co/OpenLLM-France/Lucie-7B/tree/step0075000), ["`step0100000`"](https://huggingface.co/OpenLLM-France/Lucie-7B/tree/step0100000), ..., ["`step0750000`"](https://huggingface.co/OpenLLM-France/Lucie-7B/tree/step0750000): each 25000 steps from 25k to 750k steps.
|
| 131 |
-
* ["`step0753851`"](https://huggingface.co/OpenLLM-France/Lucie-7B/tree/step0753851): last pre-training step before context extension and annealing.
|
| 132 |
-
|
| 133 |
-
## Training Details
|
| 134 |
-
|
| 135 |
-
### Training Data
|
| 136 |
-
|
| 137 |
-
The training dataset used for the pretraining of Lucie-7B is available
|
| 138 |
-
at [OpenLLM-France/Lucie-Training-Dataset](https://huggingface.co/datasets/OpenLLM-France/Lucie-Training-Dataset).
|
| 139 |
-
<!-- and described in ["The Lucie Training Dataset" (2024/12)](https://arxiv.org/abs/xxxx.xxxxx). -->
|
| 140 |
-
|
| 141 |
-
The initial composition of the training data is as follows:
|
| 142 |
-
|
| 143 |
-

|
| 144 |
-
|
| 145 |
-
Some of the data was upsampled to balance the training data distribution, and the final composition is as follows:
|
| 146 |
-
|
| 147 |
-

|
| 148 |
-
|
| 149 |
-
### Training Procedure
|
| 150 |
-
|
| 151 |
-
Lucie-7B is a causal decoder-only model trained on a causal language modeling task (i.e., predict the next token).
|
| 152 |
-
|
| 153 |
-
It was pre-trained on 512 H100 80GB GPUs for about 550\,000 GPU hours on [Jean Zay supercomputer](http://www.idris.fr/eng/jean-zay/jean-zay-presentation-eng.html).
|
| 154 |
-
|
| 155 |
-
The training code is available at [https://github.com/OpenLLM-France/Lucie-Training](https://github.com/OpenLLM-France/Lucie-Training).
|
| 156 |
-
It is based on [this fork of Megatron-DeepSpeed](https://github.com/OpenLLM-France/Megatron-DeepSpeed).
|
| 157 |
-
|
| 158 |
-
Optimizer checkpoints are available at [OpenLLM-France/Lucie-7B-optimizer-states](https://huggingface.co/OpenLLM-France/Lucie-7B-optimizer-states).
|
| 159 |
-
|
| 160 |
-
#### Neural Network Architecture
|
| 161 |
-
|
| 162 |
-
Lucie-7B has the same neural network architecture as Llama3.
|
| 163 |
-
It has exactly 6 706 958 336 free parameters,
|
| 164 |
-
with the following hyperparameters:
|
| 165 |
-
| **Hyperparameter** | **Value** |
|
| 166 |
-
|---------------------------|---------|
|
| 167 |
-
| Vocabulary size (\# tokens)| 65 024|
|
| 168 |
-
| ROPE theta | 500 000|
|
| 169 |
-
| \# transformer blocks | 32|
|
| 170 |
-
| \# attention heads | 32|
|
| 171 |
-
| \# key-value heads | 8|
|
| 172 |
-
| Hidden size | 4 096|
|
| 173 |
-
| Feed-Forward hidden size | 12 288|
|
| 174 |
-
| Activation | `silu`|
|
| 175 |
-
| RMS norm epsilon | 1e-5|
|
| 176 |
-
|
| 177 |
-
#### Training Hyperparameters
|
| 178 |
-
|
| 179 |
-
Training hyperparameters in torch/Megatron-DeepSpeed were the following:
|
| 180 |
-
| **Hyperparameter** | **Value** |
|
| 181 |
-
|------------------------|------------|
|
| 182 |
-
| Optimizer | `AdamW` |
|
| 183 |
-
| Precision | `bfloat16` |
|
| 184 |
-
| Initial batch size | 256 |
|
| 185 |
-
| Final batch size | 1024 |
|
| 186 |
-
| Batch size rampup | by steps of 64 over 10M samples |
|
| 187 |
-
| Context length | 4096 |
|
| 188 |
-
| Learning rate schedule | warmup + cosine annealing |
|
| 189 |
-
| Maximum Learning rate | 3e-4 |
|
| 190 |
-
| Final Learning rate | 3e-5 |
|
| 191 |
-
| Weight decay | 0.1 |
|
| 192 |
-
| Dropout | _ |
|
| 193 |
-
| Gradient clipping | 1 |
|
| 194 |
-
| Initializer range | 0.2 |
|
| 195 |
-
| Tensor Parallelism (with 512 GPUs) | 4 |
|
| 196 |
-
| Pipeline Parallelism (with 512 GPUs) | 4 |
|
| 197 |
-
| Data Parallelism (with 512 GPUs) | 32 |
|
| 198 |
-
|
| 199 |
-
|
| 200 |
-
## Acknowledgements
|
| 201 |
-
|
| 202 |
-
This work was performed using HPC resources from GENCI–IDRIS (Grant 2024-GC011015444).
|
| 203 |
-
|
| 204 |
-
Lucie-7B was created by members of [LINAGORA](https://labs.linagora.com/) and OpenLLM-France community, including in alphabetical order:
|
| 205 |
-
Christophe Cerisara (LORIA),
|
| 206 |
-
Evan Dufraisse (CEA),
|
| 207 |
-
Julie Hunter (LINAGORA),
|
| 208 |
-
Jean-Pierre Lorré (LINAGORA),
|
| 209 |
-
Jérôme Louradour (LINAGORA),
|
| 210 |
-
Michel-Marie Maudet (LINAGORA),
|
| 211 |
-
Olivier Gouvert (LINAGORA),
|
| 212 |
-
Pierre-Carl Langlais (OpSci),
|
| 213 |
-
Yaya Sy (LORIA).
|
| 214 |
-
|
| 215 |
-
## Contact
|
| 216 |
-
|
| 217 |
-
contact@openllm-france.fr
|
|
|
|
| 25 |
# top_p: 1.0
|
| 26 |
# top_k: null
|
| 27 |
# max_new_tokens: null
|
| 28 |
+
training_progress:
|
| 29 |
+
num_steps: 754351
|
| 30 |
+
num_tokens: 3123790086144
|
| 31 |
+
context_length: 32000
|
| 32 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|