ejbejaranos commited on
Commit
e97476d
·
verified ·
1 Parent(s): 017ba1b

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +110 -123
README.md CHANGED
@@ -1,199 +1,186 @@
1
  ---
2
  library_name: transformers
3
- tags: []
 
 
 
 
 
 
 
 
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
- This is the model card of a 🤗 transformers model that has been pushed on the Hub. This model card has been automatically generated.
 
 
 
 
 
 
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]
 
1
  ---
2
  library_name: transformers
3
+ tags:
4
+ - LLMs-Aviation
5
+ - AI-Regulatory-Compliance
6
+ - RAC-AI-Colombia
7
+ license: apache-2.0
8
+ datasets:
9
+ - somosnlp/Reglamento_aeronautico_Colombiano_FULL_ChatML_format_gemma
10
+ language:
11
+ - es
12
  ---
13
 
 
14
 
15
+ # Model Card for Gemma-FULL-RAC-Colombia 🛫
16
 
17
+ <p align="center">
18
+ <img src="https://cdn-uploads.huggingface.co/production/uploads/6419c2f6b4adb0e101b17b6c/JlVz94BKdUkRN8xU00EgT.png" alt="Model Illustration" width="500">
19
+ </p>
20
 
21
+ 🌟 This model card proudly presents Gemma-FULL-RAC-Colombia, a groundbreaking language model fine-tuned with precision on the Colombian Aeronautical Regulations (Reglamento Aeronáutico Colombiano, RAC) dataset. Harnessing the advanced capabilities of Google's original Gemma model, this adaptation focuses keenly on the aviation regulatory sphere within Colombia.
22
 
23
+ ## Model Details 📈
24
 
25
+ ### Model Description 📘
26
 
27
+ 🚀 The Gemma-FULL-RAC-Colombia model marks an innovative leap in deploying language models for niche domains like aviation law and regulation. Developed by Edison Bejarano and Nicolai Potes, it's finely tuned using LoRA (Low-Rank Adaptation), ensuring minimal adjustment to the model's weights while preserving the extensive knowledge and prowess of Google's Gemma. This meticulous approach guarantees not just the retention of broad language comprehension and generation skills but also a profound grasp of the terminologies, concepts, and regulatory frameworks particular to Colombian aviation.
28
 
29
+ - **Developed by:** [Edison Bejarano](https://huggingface.co/ejbejaranos) and [Nicolai Potes](https://huggingface.co/NickyNicky)
30
+ - **Funded by:** Fundación Universitaria Los Libertadores 🏛️
31
+ - **Shared by [optional]:** This project is a collective endeavor of passionate NLP and aviation regulation specialists, united by a vision to make aviation laws more accessible and understandable. 👥
32
+ - **Model type:** Causal Language Model, specially fine-tuned with LoRA for the distinct area of Colombian Aeronautical Regulations. 📊
33
+ - **Language(s) (NLP):** Spanish, tailored for the Colombian legal and regulatory context. 🇨🇴
34
+ - **License:** Apache License. This open-source license ensures that the model can be freely used, modified, and distributed. Please check the Hugging Face model page for specific licensing details. 🔓
35
+ - **Finetuned from model [optional]:** Derived from Google's Gemma model, utilizing versions such as `gemma-2b-it` for comprehensive training. 🧠
36
 
37
+ ### Loss Function through Epochs 📉
38
+ <p align="center">
39
+ <img src="https://cdn-uploads.huggingface.co/production/uploads/6419c2f6b4adb0e101b17b6c/vufJ_u_5ZrdzNcSrqwjBx.png" alt="Loss Function Graph" width="500">
40
+ </p>
 
 
 
41
 
 
42
 
43
+ ### Model Sources 📚
44
 
45
+ - **Repository:** To be added
46
+ - **Paper [optional]:** To be added
47
+ - **Demo [optional]:** To be added
48
 
49
+ ## Uses 🛠️
50
 
51
+ The Gemma-FULL-RAC-Colombia model is designed to enhance the understanding and application of the Colombian Aeronautical Regulations (RAC) through natural language processing. It's tailored for professionals and enthusiasts in the aviation industry, regulatory agencies, legal experts, and AI researchers with an interest in domain-specific language model applications.
52
 
53
+ ### Direct Use 🎯
54
 
55
+ The model can be directly used to generate text, answer questions, and provide insights related to the Colombian Aeronautical Regulations without further fine-tuning. It's ideal for creating educational content, simplifying legal language, and assisting in regulatory compliance efforts.
56
 
57
+ ### Downstream Use [optional] 🔄
58
 
59
+ When fine-tuned, Gemma-FULL-RAC-Colombia can be integrated into larger systems for automated compliance checks, document summarization, and even training simulators for pilots and air traffic controllers, offering a deeper, contextual understanding of regulations.
60
 
61
+ ### Out-of-Scope Use 🚫
62
 
63
+ Misuse includes any application that promotes unethical practices, misinterprets aviation law, or uses the model for malicious purposes. The model is not designed for navigational purposes or to replace professional legal advice.
64
 
65
+ ## Bias, Risks, and Limitations ⚠️
66
 
67
+ The model, while powerful, has limitations inherent to AI, including biases present in the training data. It may not cover all nuances of aviation regulations outside of Colombia or adapt to changes in law without updates.
68
 
69
+ ### Recommendations 📝
70
 
71
+ Users should verify model outputs against current regulations and consult with professionals for critical applications. Awareness of the model's scope and limitations is crucial for effective use.
72
 
73
+ ## How to Get Started with the Model 🚀
74
 
75
+ ```python
76
+ # Assuming Hugging Face's Transformers and Datasets are installed
77
+ from transformers import AutoModelForCausalLM, AutoTokenizer
78
 
79
+ model_name = "somosnlp/gemma-FULL-RAC-Colombia"
80
+ tokenizer = AutoTokenizer.from_pretrained(model_name)
81
+ model = AutoModelForCausalLM.from_pretrained(model_name)
82
 
83
+ # Example usage
84
+ input_text = "Explain the regulations for drone flights in Colombia."
85
+ input_ids = tokenizer.encode(input_text, return_tensors="pt")
86
+ output = model.generate(input_ids, max_length=100)
87
+ print(tokenizer.decode(output[0], skip_special_tokens=True))
88
+ ```
89
 
90
+ ## Training Details 🧠
91
 
92
+ The Gemma-FULL-RAC-Colombia model was specifically fine-tuned on the "Reglamento Aeronáutico Colombiano FULL ChatML format gemma" dataset available through Hugging Face Datasets. This dataset encompasses a comprehensive collection of the Colombian Aeronautical Regulations (RAC), tailored to train the model for understanding and generating responses related to aviation regulations in Colombia.
93
 
94
+ ### Environment and Libraries 🖥️
95
 
96
+ The training was executed in a Python environment leveraging the following main libraries:
97
 
98
+ - `transformers` for model loading and fine-tuning facilities.
99
+ - `datasets` for handling the dataset efficiently.
100
+ - `torch` for the underlying deep learning framework.
101
+ - `peft` for applying the Low-Rank Adaptation (LoRA) adjustments to the model.
102
 
103
+ ### Model Architecture 🏗️
104
 
105
+ The base model is Google's Gemma, an advanced language model with billions of parameters, capable of understanding context and generating human-like text. For this project, specific versions of Gemma (e.g., `gemma-2b-it`) were used as starting points.
106
 
107
+ ### Fine-tuning with LoRA 🔧
108
 
109
+ LoRA (Low-Rank Adaptation) was employed to adapt the Gemma model to the specific domain of Colombian Aeronautical Regulations without extensively retraining the entire model. This approach allows for the efficient update of the model's weights, focusing on the adaptation layers to integrate the domain-specific knowledge effectively.
110
 
111
+ - **LoRA Configurations:** r=64, lora_alpha=32, among other settings tailored to balance performance and efficiency.
112
 
113
+ ### Training Process 🚀
114
 
115
+ Training was carried out considering the following key parameters:
116
 
117
+ - Batch size: Adapted based on the available computational resources.
118
+ - Learning rate: Fine-tuned for optimal convergence without overfitting.
119
+ - Epochs: The model was trained for a sufficient number of epochs to ensure that it adequately learned from the dataset, with early stopping criteria to prevent overfitting.
120
 
121
+ ### Evaluation and Performance 📊
122
+ '''Pending'''
123
 
124
+ ### Model Merging and Saving 💾
125
 
126
+ After fine-tuning, the LoRA-adjusted weights were merged back with the base Gemma model to create the final version of Gemma-FULL-RAC-Colombia. The model was then saved and made available through Hugging Face, ensuring easy access for further use and development.
127
 
128
+ The training process was meticulously documented to ensure reproducibility and facilitate further research and development in the domain of specialized language models for regulatory compliance and legal tech applications.
129
 
 
130
 
131
+ ### Training Data 📚
132
 
133
+ The training data utilized for fine-tuning the Gemma-FULL-RAC-Colombia model is available on Hugging Face Datasets under the dataset identifier:
134
 
135
+ [somosnlp/Reglamento_aeronautico_Colombiano_FULL_ChatML_format_gemma](https://huggingface.co/datasets/somosnlp/Reglamento_aeronautico_Colombiano_FULL_ChatML_format_gemma)
136
 
137
+ This dataset comprises a targeted collection of the Colombian Aeronautical Regulations (RAC), specifically including regulations from RAC 1 to RAC 5. The selection is optimized for chat and language modeling tasks, aiming to train the model to understand and generate accurate responses related to the initial segments of Colombian aviation regulations.
138
 
 
139
 
140
+ ### Training Procedure
141
 
142
+ The Gemma-FULL-RAC-Colombia model underwent a meticulous training process, leveraging the NVIDIA V100 GPU for its computational needs. The procedure was designed to fine-tune the model on a dataset comprising sections RAC 1 to RAC 5 of the Colombian Aeronautical Regulations.
143
 
144
+ #### Preprocessing
145
 
146
+ The dataset was preprocessed to convert the regulatory texts into a format suitable for the model, utilizing the tokenizer associated with the `google/gemma-2b-it` model. This step ensured that the input data was optimized for training efficiency and model comprehension.
147
 
148
+ #### Training Hyperparameters
149
 
150
+ The training utilized a mixed precision regime to balance computational efficiency and model accuracy. Specific hyperparameters included:
151
 
152
+ - **Training regime:** Mixed precision (FP16)
153
 
154
+ #### Speeds, Sizes, Times
155
 
156
+ The model was trained over a span of approximately 4.67 hours (runtime: 16,020 seconds), with checkpoints indicating progress at various intervals. The training demonstrated efficient utilization of the V100 GPU, maintaining a steady throughput.
157
 
158
+ #### Factors
159
 
160
+ Training focused on the model's ability to understand and generate text related to the specific domain of Colombian Aeronautical Regulations.
161
 
162
+ #### Metrics
163
 
164
+ The primary metric for evaluating the model's performance was the training loss, which was observed to decrease steadily over time, indicating effective learning and adaptation by the model.
165
 
166
+ ### Results
167
 
168
+ The training process resulted in a model capable of accurately interpreting and responding to queries related to the Colombian Aeronautical Regulations, with a notable final training loss of 0.6204 at the last checkpoint.
169
 
170
  ## Environmental Impact
171
 
172
+ Given the use of an NVIDIA V100 GPU for approximately 4.67 hours, the carbon emissions can be estimated using the Machine Learning Impact calculator. This tool accounts for the hardware type, runtime, and other factors to provide a comprehensive view of the environmental impact of training large AI models.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
173
 
174
+ - **Hardware Type:** NVIDIA V100 GPU
175
+ - **Hours used:** ~4.67
176
+ - **Carbon Emitted:** 554.5625
177
 
178
+ # Constants
179
+ power_consumption_kW = 0.25 # 250 watts in kW
180
+ runtime_hours = 4.67
181
+ carbon_intensity_gCO2eq_per_kWh = 475 # Global average carbon intensity
182
 
183
+ # Calculate carbon emissions
184
+ carbon_emitted_gCO2eq = power_consumption_kW * runtime_hours * carbon_intensity_gCO2eq_per_kWh
185
 
186
+ carbon_emitted_gCO2eq = 554.5625