forbiddensoul90 commited on
Commit
5f87ea2
·
verified ·
1 Parent(s): 8880d20
README.md CHANGED
@@ -1,119 +1,202 @@
1
- ---
2
- base_model: meta-llama/Llama-3.1-8B-Instruct
3
- tags:
4
- - text-generation-inference
5
- - transformers
6
- - unsloth
7
- - llama
8
- - trl
9
- license: apache-2.0
10
- language:
11
- - lb
12
- - en
13
- ---
14
- # Lux-Llama
15
-
16
- This repository contains a fine-tuned version of the Llama-3.1-8B-Instruct model, specifically adapted for Luxembourgish. The fine-tuning was performed using LoRA (Low-Rank Adaptation) on a dataset crafted to generate Chain-of-Thought (CoT) reasoning in Luxembourgish. The fine-tuning process utilized the computational resources provided by [Meluxina](https://www.luxprovide.lu/meluxina), a high-performance computing (HPC) platform operated by LuxProvide.
17
-
18
- ## Model Overview
19
- - **Base Model:** Llama-3.1-8B-Instruct
20
- - **Fine-Tuning Method:** LoRA (Low-Rank Adaptation)
21
- - **Dataset:** Luxembourgish Chain-of-Thought (CoT) dataset
22
- - **Compute Platform:** Meluxina by LuxProvide
23
- - **Fine-Tuning Framework:** [Unsloth](https://github.com/unsloth/unsloth)
24
-
25
- ## About Meluxina
26
- [Meluxina](https://www.luxprovide.lu/meluxina) is Luxembourg's national supercomputer, launched in June 2021 by LuxProvide. It is built on the EVIDEN BullSequana XH2000 platform and provides:
27
- - **18 PetaFlops** of computing power.
28
- - **20 PetaBytes** of storage capacity.
29
- - A **scalable architecture** integrating simulation, modeling, data analytics, and AI.
30
-
31
- Meluxina was ranked 36th globally and recognized as the greenest supercomputer in the EU within the Top500 ranking. Named after Luxembourg's legend of the mermaid Melusina, it symbolizes digital innovation and employs water-cooling technology for energy efficiency.
32
-
33
- ## Features
34
- - **Language:** Luxembourgish
35
- - **Specialization:** Chain-of-Thought reasoning for complex problem-solving and step-by-step explanations.
36
- - **Efficiency:** LoRA fine-tuning ensures minimal computational overhead while maintaining high performance.
37
-
38
- ## Installation
39
- To use the fine-tuned model, ensure you have the following dependencies installed:
40
-
41
- ```python
42
- %%capture
43
- !pip install unsloth
44
- # Also get the latest nightly Unsloth!
45
- !pip uninstall unsloth -y && pip install --upgrade --no-cache-dir --no-deps git+https://github.com/unslothai/unsloth.git
46
- ```
47
-
48
- You can then load the model as follows:
49
-
50
- ```python
51
- from unsloth import FastLanguageModel
52
- import torch
53
- max_seq_length = 8192 # Choose any! We auto support RoPE Scaling internally!
54
- dtype = None # None for auto detection. Float16 for Tesla T4, V100, Bfloat16 for Ampere+
55
- load_in_4bit = True # Use 4bit quantization to reduce memory usage. Can be False.
56
-
57
- model, tokenizer = FastLanguageModel.from_pretrained(
58
- model_name = "aiplanet/Lux-Llama",
59
- max_seq_length = max_seq_length,
60
- dtype = dtype,
61
- load_in_4bit = load_in_4bit,
62
- )
63
- FastLanguageModel.for_inference(model) # Enable native 2x faster inference
64
-
65
- alpaca_prompt = """Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
66
-
67
- ### Instruction:
68
- {}
69
-
70
- ### Input:
71
- {}
72
-
73
- ### Response:
74
- {}"""
75
-
76
- inputs = tokenizer(
77
- [
78
- alpaca_prompt.format(
79
- "You are a helpful chatbot. Your primary task is to provide clear and relevant responses to user queries. Always respond in Luxembourgish unless the user explicitly requests otherwise. You must NOT provide a translation for your reply.", # instruction
80
- "Erklär mech Schrëtt fir Schrëtt, wéi ee Brout bäckt.", # input
81
- "", # output - leave this blank for generation!
82
- )
83
- ], return_tensors = "pt").to("cuda")
84
-
85
- outputs = model.generate(**inputs, max_new_tokens = 512, repetition_penalty = 1.2)
86
- # tokenizer.batch_decode(outputs, skip_special_tokens = True
87
- tokenizer.batch_decode(outputs)
88
- ```
89
-
90
- Output:
91
-
92
- ```python
93
- # Fir e purescht Brout ze baaken, brauchst du een Härzchen (ca 250g) an d'Zucker (50g). D'Recept kann och mat Käsekugeln oder Nüssen ergänzt ginn. Et ass wichteg, dass ee gutt nachbaket! Ee muss also den Ofen op 180°C schalten an de Brot am ëmmersten drënne Plätz vun der Ablage stellen. De Baackezäit hängt vu der Gréisst vum Bierg an dem Wénkel, dee ee beim Bauen benutzt. Fir en normale Brotpartee staavwouert et zirka 45-60 Minutten. Määnter net, ob ee dat selwer ausprobiieren wollet!
94
- ```
95
-
96
- ## Dataset Details
97
- The Luxembourgish Chain-of-Thought (CoT) dataset used for fine-tuning consists of:
98
- - **Examples:** Handcrafted and curated examples of multi-step reasoning tasks.
99
- - **Domains:** Mathematics, general knowledge, and real-life problem-solving scenarios.
100
- - **Format:** Text sequences with labeled CoT reasoning in Luxembourgish.
101
-
102
- ## Fine-Tuning Process
103
- 1. **Framework:** The fine-tuning was conducted using [Unsloth](https://github.com/unsloth/unsloth), a LoRA-based fine-tuning library.
104
- 2. **Steps:**
105
- - Initialized the Llama-3.1-8B-Instruct model.
106
- - Applied LoRA adapters for efficient training.
107
- - Fine-tuned using the Luxembourgish CoT dataset on the Meluxina HPC cluster.
108
- 3. **Hardware:** High-performance A100 GPUs provided by Meluxina ensured rapid convergence.
109
-
110
- ## Benchmarking
111
- - *Under progress*
112
-
113
- ## Acknowledgments
114
- This work leverages computational resources and support from [Meluxina](https://www.luxprovide.lu/meluxina) by LuxProvide.
115
-
116
- <img src="https://www.luxprovide.lu/wp-content/themes/luxprovide2023/public/images/logo/logo_notagline_color_blue.4b07cb.svg" alt="LuxProvide Logo" width="50%">
117
-
118
- <img src="https://docs.lxp.lu/FAQ/images/MeluXina_Logo.png" alt="Meluxina Logo" width="50%">
119
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ base_model: unsloth/Meta-Llama-3.1-8B-Instruct-bnb-4bit
3
+ library_name: peft
4
+ ---
5
+
6
+ # Model Card for Model ID
7
+
8
+ <!-- Provide a quick summary of what the model is/does. -->
9
+
10
+
11
+
12
+ ## Model Details
13
+
14
+ ### Model Description
15
+
16
+ <!-- Provide a longer summary of what this model is. -->
17
+
18
+
19
+
20
+ - **Developed by:** [More Information Needed]
21
+ - **Funded by [optional]:** [More Information Needed]
22
+ - **Shared by [optional]:** [More Information Needed]
23
+ - **Model type:** [More Information Needed]
24
+ - **Language(s) (NLP):** [More Information Needed]
25
+ - **License:** [More Information Needed]
26
+ - **Finetuned from model [optional]:** [More Information Needed]
27
+
28
+ ### Model Sources [optional]
29
+
30
+ <!-- Provide the basic links for the model. -->
31
+
32
+ - **Repository:** [More Information Needed]
33
+ - **Paper [optional]:** [More Information Needed]
34
+ - **Demo [optional]:** [More Information Needed]
35
+
36
+ ## Uses
37
+
38
+ <!-- Address questions around how the model is intended to be used, including the foreseeable users of the model and those affected by the model. -->
39
+
40
+ ### Direct Use
41
+
42
+ <!-- This section is for the model use without fine-tuning or plugging into a larger ecosystem/app. -->
43
+
44
+ [More Information Needed]
45
+
46
+ ### Downstream Use [optional]
47
+
48
+ <!-- This section is for the model use when fine-tuned for a task, or when plugged into a larger ecosystem/app -->
49
+
50
+ [More Information Needed]
51
+
52
+ ### Out-of-Scope Use
53
+
54
+ <!-- This section addresses misuse, malicious use, and uses that the model will not work well for. -->
55
+
56
+ [More Information Needed]
57
+
58
+ ## Bias, Risks, and Limitations
59
+
60
+ <!-- This section is meant to convey both technical and sociotechnical limitations. -->
61
+
62
+ [More Information Needed]
63
+
64
+ ### Recommendations
65
+
66
+ <!-- This section is meant to convey recommendations with respect to the bias, risk, and technical limitations. -->
67
+
68
+ Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations.
69
+
70
+ ## How to Get Started with the Model
71
+
72
+ Use the code below to get started with the model.
73
+
74
+ [More Information Needed]
75
+
76
+ ## Training Details
77
+
78
+ ### Training Data
79
+
80
+ <!-- This should link to a Dataset Card, perhaps with a short stub of information on what the training data is all about as well as documentation related to data pre-processing or additional filtering. -->
81
+
82
+ [More Information Needed]
83
+
84
+ ### Training Procedure
85
+
86
+ <!-- This relates heavily to the Technical Specifications. Content here should link to that section when it is relevant to the training procedure. -->
87
+
88
+ #### Preprocessing [optional]
89
+
90
+ [More Information Needed]
91
+
92
+
93
+ #### Training Hyperparameters
94
+
95
+ - **Training regime:** [More Information Needed] <!--fp32, fp16 mixed precision, bf16 mixed precision, bf16 non-mixed precision, fp16 non-mixed precision, fp8 mixed precision -->
96
+
97
+ #### Speeds, Sizes, Times [optional]
98
+
99
+ <!-- This section provides information about throughput, start/end time, checkpoint size if relevant, etc. -->
100
+
101
+ [More Information Needed]
102
+
103
+ ## Evaluation
104
+
105
+ <!-- This section describes the evaluation protocols and provides the results. -->
106
+
107
+ ### Testing Data, Factors & Metrics
108
+
109
+ #### Testing Data
110
+
111
+ <!-- This should link to a Dataset Card if possible. -->
112
+
113
+ [More Information Needed]
114
+
115
+ #### Factors
116
+
117
+ <!-- These are the things the evaluation is disaggregating by, e.g., subpopulations or domains. -->
118
+
119
+ [More Information Needed]
120
+
121
+ #### Metrics
122
+
123
+ <!-- These are the evaluation metrics being used, ideally with a description of why. -->
124
+
125
+ [More Information Needed]
126
+
127
+ ### Results
128
+
129
+ [More Information Needed]
130
+
131
+ #### Summary
132
+
133
+
134
+
135
+ ## Model Examination [optional]
136
+
137
+ <!-- Relevant interpretability work for the model goes here -->
138
+
139
+ [More Information Needed]
140
+
141
+ ## Environmental Impact
142
+
143
+ <!-- Total emissions (in grams of CO2eq) and additional considerations, such as electricity usage, go here. Edit the suggested text below accordingly -->
144
+
145
+ Carbon emissions can be estimated using the [Machine Learning Impact calculator](https://mlco2.github.io/impact#compute) presented in [Lacoste et al. (2019)](https://arxiv.org/abs/1910.09700).
146
+
147
+ - **Hardware Type:** [More Information Needed]
148
+ - **Hours used:** [More Information Needed]
149
+ - **Cloud Provider:** [More Information Needed]
150
+ - **Compute Region:** [More Information Needed]
151
+ - **Carbon Emitted:** [More Information Needed]
152
+
153
+ ## Technical Specifications [optional]
154
+
155
+ ### Model Architecture and Objective
156
+
157
+ [More Information Needed]
158
+
159
+ ### Compute Infrastructure
160
+
161
+ [More Information Needed]
162
+
163
+ #### Hardware
164
+
165
+ [More Information Needed]
166
+
167
+ #### Software
168
+
169
+ [More Information Needed]
170
+
171
+ ## Citation [optional]
172
+
173
+ <!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. -->
174
+
175
+ **BibTeX:**
176
+
177
+ [More Information Needed]
178
+
179
+ **APA:**
180
+
181
+ [More Information Needed]
182
+
183
+ ## Glossary [optional]
184
+
185
+ <!-- If relevant, include terms and calculations in this section that can help readers understand the model or model card. -->
186
+
187
+ [More Information Needed]
188
+
189
+ ## More Information [optional]
190
+
191
+ [More Information Needed]
192
+
193
+ ## Model Card Authors [optional]
194
+
195
+ [More Information Needed]
196
+
197
+ ## Model Card Contact
198
+
199
+ [More Information Needed]
200
+ ### Framework versions
201
+
202
+ - PEFT 0.13.2
adapter_config.json CHANGED
@@ -1,34 +1,34 @@
1
- {
2
- "alpha_pattern": {},
3
- "auto_mapping": null,
4
- "base_model_name_or_path": "unsloth/Meta-Llama-3.1-8B-Instruct-bnb-4bit",
5
- "bias": "none",
6
- "fan_in_fan_out": false,
7
- "inference_mode": true,
8
- "init_lora_weights": true,
9
- "layer_replication": null,
10
- "layers_pattern": null,
11
- "layers_to_transform": null,
12
- "loftq_config": {},
13
- "lora_alpha": 16,
14
- "lora_dropout": 0,
15
- "megatron_config": null,
16
- "megatron_core": "megatron.core",
17
- "modules_to_save": null,
18
- "peft_type": "LORA",
19
- "r": 16,
20
- "rank_pattern": {},
21
- "revision": null,
22
- "target_modules": [
23
- "o_proj",
24
- "v_proj",
25
- "gate_proj",
26
- "q_proj",
27
- "k_proj",
28
- "up_proj",
29
- "down_proj"
30
- ],
31
- "task_type": "CAUSAL_LM",
32
- "use_dora": false,
33
- "use_rslora": false
34
  }
 
1
+ {
2
+ "alpha_pattern": {},
3
+ "auto_mapping": null,
4
+ "base_model_name_or_path": "unsloth/Meta-Llama-3.1-8B-Instruct-bnb-4bit",
5
+ "bias": "none",
6
+ "fan_in_fan_out": false,
7
+ "inference_mode": true,
8
+ "init_lora_weights": true,
9
+ "layer_replication": null,
10
+ "layers_pattern": null,
11
+ "layers_to_transform": null,
12
+ "loftq_config": {},
13
+ "lora_alpha": 16,
14
+ "lora_dropout": 0,
15
+ "megatron_config": null,
16
+ "megatron_core": "megatron.core",
17
+ "modules_to_save": null,
18
+ "peft_type": "LORA",
19
+ "r": 8,
20
+ "rank_pattern": {},
21
+ "revision": null,
22
+ "target_modules": [
23
+ "o_proj",
24
+ "v_proj",
25
+ "up_proj",
26
+ "k_proj",
27
+ "gate_proj",
28
+ "q_proj",
29
+ "down_proj"
30
+ ],
31
+ "task_type": "CAUSAL_LM",
32
+ "use_dora": false,
33
+ "use_rslora": false
34
  }
adapter_model.safetensors CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:002bf89a929e9c0bd7cc7a55e989bbd218142e85484d3300257af50911b5badd
3
- size 167832240
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:973f11c37751e93450ba308b7deedee93975d4287d44e0037b9f82630298de36
3
+ size 83945296
special_tokens_map.json CHANGED
@@ -1,23 +1,23 @@
1
- {
2
- "bos_token": {
3
- "content": "<|begin_of_text|>",
4
- "lstrip": false,
5
- "normalized": false,
6
- "rstrip": false,
7
- "single_word": false
8
- },
9
- "eos_token": {
10
- "content": "<|eot_id|>",
11
- "lstrip": false,
12
- "normalized": false,
13
- "rstrip": false,
14
- "single_word": false
15
- },
16
- "pad_token": {
17
- "content": "<|finetune_right_pad_id|>",
18
- "lstrip": false,
19
- "normalized": false,
20
- "rstrip": false,
21
- "single_word": false
22
- }
23
- }
 
1
+ {
2
+ "bos_token": {
3
+ "content": "<|begin_of_text|>",
4
+ "lstrip": false,
5
+ "normalized": false,
6
+ "rstrip": false,
7
+ "single_word": false
8
+ },
9
+ "eos_token": {
10
+ "content": "<|eot_id|>",
11
+ "lstrip": false,
12
+ "normalized": false,
13
+ "rstrip": false,
14
+ "single_word": false
15
+ },
16
+ "pad_token": {
17
+ "content": "<|finetune_right_pad_id|>",
18
+ "lstrip": false,
19
+ "normalized": false,
20
+ "rstrip": false,
21
+ "single_word": false
22
+ }
23
+ }
tokenizer_config.json CHANGED
The diff for this file is too large to render. See raw diff