shahidmo99
commited on
Commit
•
d2aa8d2
1
Parent(s):
dd084e7
Update README.md
Browse files
README.md
CHANGED
@@ -1,6 +1,17 @@
|
|
1 |
---
|
2 |
-
library_name:
|
3 |
-
tags:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4 |
---
|
5 |
|
6 |
# Model Card for Model ID
|
@@ -9,191 +20,106 @@ tags: []
|
|
9 |
|
10 |
|
11 |
|
12 |
-
|
13 |
|
14 |
-
|
15 |
|
16 |
-
|
17 |
|
18 |
-
|
19 |
-
|
20 |
-
- **
|
21 |
-
- **
|
22 |
-
- **
|
23 |
-
- **
|
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 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
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 |
-
|
|
|
|
|
|
|
53 |
|
54 |
-
|
55 |
|
56 |
-
|
|
|
|
|
57 |
|
58 |
-
|
59 |
-
|
60 |
-
|
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 |
-
|
81 |
-
|
82 |
-
[More Information Needed]
|
83 |
|
84 |
### Training Procedure
|
|
|
|
|
85 |
|
86 |
-
|
87 |
-
|
88 |
-
|
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 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
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 |
-
|
|
|
|
|
|
1 |
---
|
2 |
+
library_name: peft
|
3 |
+
tags:
|
4 |
+
- lora
|
5 |
+
- generated_from_trainer
|
6 |
+
- gpt2
|
7 |
+
- instruction-tuning
|
8 |
+
license: apache-2.0
|
9 |
+
datasets:
|
10 |
+
- tatsu-lab/alpaca
|
11 |
+
language:
|
12 |
+
- en
|
13 |
+
base_model:
|
14 |
+
- distilbert/distilgpt2
|
15 |
---
|
16 |
|
17 |
# Model Card for Model ID
|
|
|
20 |
|
21 |
|
22 |
|
23 |
+
# LoRA-Adapted GPT2-Distilled Model
|
24 |
|
25 |
+
## Model Description
|
26 |
|
27 |
+
This model is a LoRA-adapted version of distilled GPT2, fine-tuned on the Alpaca dataset to enhance its instruction-following capabilities. The model uses Low-Rank Adaptation (LoRA) to efficiently fine-tune the base model while maintaining its core capabilities and adding new instruction-following abilities.
|
28 |
|
29 |
+
### Model Details
|
30 |
+
- **Developed by:** Shahid Mohiuddin
|
31 |
+
- **Model type:** LoRA-adapted GPT2 (Instruction-tuned Language Model)
|
32 |
+
- **Language(s):** English
|
33 |
+
- **License:** Apache 2.0
|
34 |
+
- **Finetuned from model:** distilbert/distilgpt2
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
35 |
|
36 |
## Uses
|
37 |
|
|
|
|
|
38 |
### Direct Use
|
39 |
|
40 |
+
This model is designed for instruction-following tasks and can be used for:
|
41 |
+
- Creative writing and storytelling
|
42 |
+
- Explanatory content generation
|
43 |
+
- Question answering
|
44 |
+
- Task-based instructions
|
|
|
|
|
|
|
|
|
45 |
|
46 |
+
The model shows particular improvements in:
|
47 |
+
- Narrative coherence
|
48 |
+
- Contextual understanding
|
49 |
+
- Structured reasoning
|
50 |
|
51 |
+
### Code Example
|
52 |
|
53 |
+
```python
|
54 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
55 |
+
from peft import PeftModel
|
56 |
|
57 |
+
base_model = AutoModelForCausalLM.from_pretrained("distilbert/distilgpt2")
|
58 |
+
model = PeftModel.from_pretrained(base_model, "shahidmo/gpt2-distilled-lora-alpaca")
|
59 |
+
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
60 |
|
61 |
## Training Details
|
62 |
|
63 |
### Training Data
|
64 |
+
- **Dataset:** Alpaca 52k instructions dataset
|
65 |
+
- **Preprocessing:** Standard text preprocessing with instruction-response format
|
|
|
|
|
66 |
|
67 |
### Training Procedure
|
68 |
+
- **Training Type:** LoRA (Low-Rank Adaptation)
|
69 |
+
- **Hardware:** A4000 16GB GPU
|
70 |
|
71 |
+
### Model Architecture
|
72 |
+
- **Base Model:** distilbert/distilgpt2
|
73 |
+
- **Adaptation Method:** LoRA
|
74 |
+
- **Parameter-Efficient Fine-Tuning:** Used LoRA to minimize training parameters while maximizing adaptation effectiveness
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
75 |
|
76 |
## Evaluation
|
77 |
|
78 |
+
### Example Outputs
|
79 |
+
|
80 |
+
The model shows significant improvements over the base model in several areas:
|
81 |
+
|
82 |
+
1. Creative Writing Example:
|
83 |
+
**Prompt**: "Write a short story about a magical key."
|
84 |
+
|
85 |
+
**Base Model:**
|
86 |
+
The Key of My Life is the Magic Ring!
|
87 |
+
|
88 |
+
**LoRA-tuned Model:**
|
89 |
+
A magic secret was discovered in the garden of an ancient Egyptian temple, hidden beneath its walls and deep into their own soil. The mystery behind the mysterious gemstone is that it's not only due to being buried under water but also because there are otherworldly elements lurking underneath this precious treasure—something which has been revealed by archaeologists at Uppsala University.
|
90 |
+
|
91 |
+
2. Scientific Explanation Example:
|
92 |
+
**Prompt**: "Explain why leaves change color in autumn using simple terms."
|
93 |
+
|
94 |
+
**Base Model:**
|
95 |
+
Autumn means a cold winter, with temperatures rising and falling as the seasons cool down on top of each other. Leaves can be used to warm up
|
96 |
+
|
97 |
+
**LoRA-tuned Model:**
|
98 |
+
Leaves change colors as they grow and mature, creating a more uniform appearance for the season's seasonal seasons. As winter progresses, blueberries will begin
|
99 |
+
|
100 |
+
## Limitations
|
101 |
+
|
102 |
+
While the model shows improvements in instruction following and coherence, users should be aware of these limitations:
|
103 |
+
- Limited context window inherited from base GPT2
|
104 |
+
- May occasionally generate incomplete or inconsistent responses
|
105 |
+
- Scientific explanations may need fact-checking
|
106 |
+
|
107 |
+
## Citation
|
108 |
+
|
109 |
+
If you use this model in your research, please cite:
|
110 |
+
```bibtex
|
111 |
+
@misc{gpt2-distilled-lora-alpaca,
|
112 |
+
author = {Mohammed Khaja, Shahid Mohiuddin},
|
113 |
+
title = {LoRA-Adapted GPT2-Distilled Model},
|
114 |
+
year = {2024},
|
115 |
+
publisher = {Hugging Face},
|
116 |
+
journal = {Hugging Face Model Hub},
|
117 |
+
howpublished = {\url{https://huggingface.co/shahidmo/gpt2-distilled-lora-alpaca}}
|
118 |
+
}
|
119 |
+
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
120 |
|
121 |
## Model Card Contact
|
122 |
|
123 |
+
For questions about this model, please contact Shahid Mohammed via Hugging Face.
|
124 |
+
|
125 |
+
Version 2 of 2
|