Update README.md
Browse files
README.md
CHANGED
@@ -1,208 +1,143 @@
|
|
1 |
---
|
2 |
library_name: transformers
|
3 |
tags:
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
|
|
|
|
|
|
|
|
|
|
12 |
---
|
13 |
|
14 |
|
15 |
-
# Model Card for Model
|
16 |
-
|
17 |
-
<!-- Provide a quick summary of what the model is/does. -->
|
18 |
-
|
19 |
-
|
20 |
|
21 |
## Model Details
|
22 |
|
23 |
### Model Description
|
24 |
|
25 |
-
|
26 |
-
|
27 |
-
This is the model card of a 🤗 transformers model that has been pushed on the Hub. This model card has been automatically generated.
|
28 |
-
|
29 |
-
- **Developed by:** [More Information Needed]
|
30 |
-
- **Funded by [optional]:** [More Information Needed]
|
31 |
-
- **Shared by [optional]:** [More Information Needed]
|
32 |
-
- **Model type:** [More Information Needed]
|
33 |
-
- **Language(s) (NLP):** [More Information Needed]
|
34 |
-
- **License:** [More Information Needed]
|
35 |
-
- **Finetuned from model [optional]:** [More Information Needed]
|
36 |
-
|
37 |
-
### Model Sources [optional]
|
38 |
|
39 |
-
|
40 |
-
|
41 |
-
- **
|
42 |
-
- **
|
43 |
-
- **
|
44 |
|
45 |
## Uses
|
46 |
|
47 |
-
<!-- Address questions around how the model is intended to be used, including the foreseeable users of the model and those affected by the model. -->
|
48 |
-
|
49 |
### Direct Use
|
50 |
|
51 |
-
|
52 |
-
|
53 |
-
[More Information Needed]
|
54 |
|
55 |
-
### Downstream Use
|
56 |
|
57 |
-
|
58 |
-
|
59 |
-
[More Information Needed]
|
60 |
|
61 |
### Out-of-Scope Use
|
62 |
|
63 |
-
|
64 |
-
|
65 |
-
[More Information Needed]
|
66 |
|
67 |
## Bias, Risks, and Limitations
|
68 |
|
69 |
-
|
70 |
-
|
71 |
-
[More Information Needed]
|
72 |
|
73 |
### Recommendations
|
74 |
|
75 |
-
|
76 |
-
|
77 |
-
Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations.
|
78 |
|
79 |
## How to Get Started with the Model
|
80 |
|
81 |
-
Use the code
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
82 |
|
83 |
-
|
|
|
|
|
|
|
|
|
|
|
84 |
|
85 |
## Training Details
|
86 |
|
87 |
### Training Data
|
88 |
|
89 |
-
|
90 |
-
|
91 |
-
[More Information Needed]
|
92 |
|
93 |
### Training Procedure
|
94 |
|
95 |
-
|
96 |
-
|
97 |
-
#### Preprocessing [optional]
|
98 |
|
99 |
-
|
|
|
|
|
|
|
|
|
|
|
100 |
|
101 |
|
102 |
#### Training Hyperparameters
|
103 |
|
104 |
-
|
105 |
-
|
106 |
-
#### Speeds, Sizes, Times [optional]
|
107 |
-
|
108 |
-
<!-- This section provides information about throughput, start/end time, checkpoint size if relevant, etc. -->
|
109 |
-
|
110 |
-
[More Information Needed]
|
111 |
-
|
112 |
-
## Evaluation
|
113 |
-
|
114 |
-
<!-- This section describes the evaluation protocols and provides the results. -->
|
115 |
-
|
116 |
-
### Testing Data, Factors & Metrics
|
117 |
|
118 |
-
|
119 |
|
120 |
-
|
121 |
|
122 |
-
|
123 |
|
124 |
-
|
125 |
|
126 |
-
|
127 |
|
128 |
-
|
129 |
|
130 |
-
#### Metrics
|
131 |
|
132 |
-
|
133 |
|
134 |
-
|
|
|
135 |
|
136 |
-
### Results
|
137 |
|
138 |
-
|
139 |
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
## Model Examination [optional]
|
145 |
-
|
146 |
-
<!-- Relevant interpretability work for the model goes here -->
|
147 |
-
|
148 |
-
[More Information Needed]
|
149 |
-
|
150 |
-
## Environmental Impact
|
151 |
-
|
152 |
-
<!-- Total emissions (in grams of CO2eq) and additional considerations, such as electricity usage, go here. Edit the suggested text below accordingly -->
|
153 |
-
|
154 |
-
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).
|
155 |
-
|
156 |
-
- **Hardware Type:** [More Information Needed]
|
157 |
-
- **Hours used:** [More Information Needed]
|
158 |
-
- **Cloud Provider:** [More Information Needed]
|
159 |
-
- **Compute Region:** [More Information Needed]
|
160 |
-
- **Carbon Emitted:** [More Information Needed]
|
161 |
-
|
162 |
-
## Technical Specifications [optional]
|
163 |
|
164 |
### Model Architecture and Objective
|
165 |
|
166 |
-
|
167 |
|
168 |
### Compute Infrastructure
|
169 |
|
170 |
-
|
171 |
|
172 |
#### Hardware
|
173 |
|
174 |
-
|
175 |
|
176 |
#### Software
|
177 |
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
**BibTeX:**
|
185 |
-
|
186 |
-
[More Information Needed]
|
187 |
-
|
188 |
-
**APA:**
|
189 |
-
|
190 |
-
[More Information Needed]
|
191 |
-
|
192 |
-
## Glossary [optional]
|
193 |
-
|
194 |
-
<!-- If relevant, include terms and calculations in this section that can help readers understand the model or model card. -->
|
195 |
-
|
196 |
-
[More Information Needed]
|
197 |
-
|
198 |
-
## More Information [optional]
|
199 |
-
|
200 |
-
[More Information Needed]
|
201 |
-
|
202 |
-
## Model Card Authors [optional]
|
203 |
-
|
204 |
-
[More Information Needed]
|
205 |
|
206 |
## Model Card Contact
|
207 |
|
208 |
-
[
|
|
|
1 |
---
|
2 |
library_name: transformers
|
3 |
tags:
|
4 |
+
- peft
|
5 |
+
- trl
|
6 |
+
- torch
|
7 |
+
- wandb
|
8 |
+
- ipex
|
9 |
+
license: apache-2.0
|
10 |
+
language:
|
11 |
+
- en
|
12 |
+
base_model:
|
13 |
+
- NousResearch/Llama-2-7b-hf
|
14 |
+
datasets:
|
15 |
+
- mlabonne/mini-platypus
|
16 |
+
pipeline_tag: text-generation
|
17 |
---
|
18 |
|
19 |
|
20 |
+
# Model Card for Fine-Tuned Llama-2-7b Model
|
|
|
|
|
|
|
|
|
21 |
|
22 |
## Model Details
|
23 |
|
24 |
### Model Description
|
25 |
|
26 |
+
This model is a fine-tuned version of the Llama-2-7b model, specifically adapted for causal language modeling tasks. The fine-tuning utilizes the PEFT (Parameter-Efficient Fine-Tuning) technique with LoRA (Low-Rank Adaptation) to optimize performance while reducing computational costs. The training was conducted using the `mlabonne/mini-platypus` dataset and incorporates features such as integration with W&B for experiment tracking and Intel's Extension for PyTorch (IPEX) for enhanced performance.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
27 |
|
28 |
+
- **Developed by:** Md. Jannatul Nayem
|
29 |
+
- **Model type:** Causal Language Model
|
30 |
+
- **Language(s) (NLP):** Engish
|
31 |
+
- **License:** Apache 2.0
|
32 |
+
- **Finetuned from model :** NousResearch/Llama-2-7b-hf
|
33 |
|
34 |
## Uses
|
35 |
|
|
|
|
|
36 |
### Direct Use
|
37 |
|
38 |
+
The model can be utilized for text generation tasks where the generation of coherent and contextually relevant text is required. This includes applications like chatbots, content creation, and interactive storytelling.
|
|
|
|
|
39 |
|
40 |
+
### Downstream Use
|
41 |
|
42 |
+
When fine-tuned, this model can serve in larger ecosystems for tasks like personalized dialogue systems, question answering, and other natural language understanding applications.
|
|
|
|
|
43 |
|
44 |
### Out-of-Scope Use
|
45 |
|
46 |
+
The model is not intended for use in generating harmful or misleading content, and users should exercise caution to prevent misuse in sensitive areas such as misinformation or hate speech.
|
|
|
|
|
47 |
|
48 |
## Bias, Risks, and Limitations
|
49 |
|
50 |
+
This model may exhibit biases inherent in the training data and should be evaluated thoroughly before deployment. Users should be aware of the potential risks and limitations associated with its use.
|
|
|
|
|
51 |
|
52 |
### Recommendations
|
53 |
|
54 |
+
Users should consider implementing bias mitigation strategies and ensure thorough evaluation of the model's outputs, especially in sensitive applications.
|
|
|
|
|
55 |
|
56 |
## How to Get Started with the Model
|
57 |
|
58 |
+
Use the following code snippet to get started with loading and using the model:
|
59 |
+
|
60 |
+
```python
|
61 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
62 |
+
|
63 |
+
model_name = "nayem-ng/mdjannatulnayem_llama2_7b_finetuned_casuallm_lora"
|
64 |
+
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
65 |
+
model = AutoModelForCausalLM.from_pretrained(model_name)
|
66 |
|
67 |
+
# Example of generating text
|
68 |
+
input_text = "Your prompt here"
|
69 |
+
inputs = tokenizer(input_text, return_tensors="pt")
|
70 |
+
outputs = model.generate(**inputs)
|
71 |
+
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
|
72 |
+
```
|
73 |
|
74 |
## Training Details
|
75 |
|
76 |
### Training Data
|
77 |
|
78 |
+
The model was fine-tuned using the mlabonne/mini-platypus dataset, which consists of diverse text inputs designed to enhance the model's capabilities in conversational settings
|
|
|
|
|
79 |
|
80 |
### Training Procedure
|
81 |
|
82 |
+
The training utilized a supervised fine-tuning procedure with the following hyperparameters:
|
|
|
|
|
83 |
|
84 |
+
Training regime: bf16 mixed precision
|
85 |
+
Number of epochs: 1
|
86 |
+
Batch size: 10
|
87 |
+
Learning rate: 2e-4
|
88 |
+
Warmup steps: 10
|
89 |
+
Gradient accumulation steps: 1
|
90 |
|
91 |
|
92 |
#### Training Hyperparameters
|
93 |
|
94 |
+
Training regime: bf16 mixed precision
|
95 |
+
Explanation: The model was trained using bfloat16 (bf16) mixed precision, which allows for faster training times and reduced memory usage compared to traditional fp32 (float32). This precision format is particularly beneficial when working with large models, as it helps to maintain numerical stability while optimizing performance on compatible hardware.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
96 |
|
97 |
+
Number of epochs: 1
|
98 |
|
99 |
+
Batch size: 10
|
100 |
|
101 |
+
Learning rate: 2e-4
|
102 |
|
103 |
+
Warmup steps: 10
|
104 |
|
105 |
+
Gradient accumulation steps: 1
|
106 |
|
107 |
+
Evaluation strategy: Evaluations are performed every 1000 steps to monitor the model's performance during training.
|
108 |
|
|
|
109 |
|
110 |
+
### Testing Data
|
111 |
|
112 |
+
Dataset Used: The evaluation was conducted using the same dataset, mlabonne/mini-platypus, used for training. This dataset is suitable for assessing the model's performance on casual language generation tasks.
|
113 |
+
[mlabonne/mini-platypus](https://huggingface.co/datasets/mlabonne/mini-platypus)
|
114 |
|
|
|
115 |
|
116 |
+
## Model Examination
|
117 |
|
118 |
+
Further interpretability studies can be conducted to understand decision-making processes within the model's responses.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
119 |
|
120 |
### Model Architecture and Objective
|
121 |
|
122 |
+
The model is based on the Transformer architecture, specifically designed for Causal Language Modeling (CLM).
|
123 |
|
124 |
### Compute Infrastructure
|
125 |
|
126 |
+
Intel® Tiber™ AI Cloud
|
127 |
|
128 |
#### Hardware
|
129 |
|
130 |
+
Intel(R) Xeon(R) Platinum 8480+
|
131 |
|
132 |
#### Software
|
133 |
|
134 |
+
PyTorch: A popular deep learning framework providing flexibility and support for dynamic computation graphs.
|
135 |
+
Transformers Library (from Hugging Face): Used for loading pre-trained models and tokenizers, enabling easy model training and fine-tuning.
|
136 |
+
PEFT Library: Specifically designed for efficient fine-tuning techniques like LoRA (Low-Rank Adaptation).
|
137 |
+
TRL Library: For supervised fine-tuning training routines.
|
138 |
+
WandB: Utilized for experiment tracking and visualizing training metrics.
|
139 |
+
Intel Extension for PyTorch (IPEX): Optimizes performance on Intel hardware, enhancing training efficiency.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
140 |
|
141 |
## Model Card Contact
|
142 |
|
143 |
+
Md. Jannatul nayem | [Mail](nayemalimran106@gmail.com) | [LinkedIn](https://www.linkedin.com/in/md-jannatul-nayem)
|