Commit
·
de11a90
unverified
·
0
Parent(s):
Upload fine-tuned TinyLLaMA LoRA adapter
Browse files- .gitattributes +3 -0
- README.md +64 -0
- adapter_config.json +34 -0
- adapter_model.safetensors +3 -0
- checkpoint-250/README.md +202 -0
- checkpoint-250/adapter_config.json +34 -0
- checkpoint-250/adapter_model.safetensors +3 -0
- checkpoint-250/optimizer.pt +3 -0
- checkpoint-250/rng_state.pth +0 -0
- checkpoint-250/scheduler.pt +3 -0
- checkpoint-250/special_tokens_map.json +30 -0
- checkpoint-250/tokenizer.json +0 -0
- checkpoint-250/tokenizer_config.json +44 -0
- checkpoint-250/trainer_state.json +209 -0
- checkpoint-250/training_args.bin +3 -0
- config.json +26 -0
- model_card.json +30 -0
- special_tokens_map.json +30 -0
- tokenizer.json +0 -0
- tokenizer_config.json +44 -0
.gitattributes
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
*.bin filter=lfs diff=lfs merge=lfs -text
|
2 |
+
*.safetensors filter=lfs diff=lfs merge=lfs -text
|
3 |
+
*.pt filter=lfs diff=lfs merge=lfs -text
|
README.md
ADDED
@@ -0,0 +1,64 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
license: apache-2.0
|
3 |
+
base_model: TinyLlama/TinyLlama-1.1B-Chat-v1.0
|
4 |
+
tags:
|
5 |
+
- tinyllama
|
6 |
+
- lora
|
7 |
+
- peft
|
8 |
+
- python
|
9 |
+
- code
|
10 |
+
- fine-tuning
|
11 |
+
model_type: causal-lm
|
12 |
+
library_name: transformers
|
13 |
+
pipeline_tag: text-generation
|
14 |
+
---
|
15 |
+
|
16 |
+
# 🐍 TinyLLaMA LoRA - Fine-tuned on Python Code
|
17 |
+
|
18 |
+
This is a **LoRA fine-tuned version** of [`TinyLlama/TinyLlama-1.1B-Chat-v1.0`](https://huggingface.co/TinyLlama/TinyLlama-1.1B-Chat-v1.0) using a subset of Python code from the `codeparrot` dataset. It is trained to generate Python functions and code snippets based on natural language or code-based prompts.
|
19 |
+
|
20 |
+
## 🔧 Training Details
|
21 |
+
|
22 |
+
- **Base model**: `TinyLlama/TinyLlama-1.1B-Chat-v1.0`
|
23 |
+
- **Adapter type**: LoRA (PEFT)
|
24 |
+
- **Dataset**: `codeparrot/codeparrot-clean-valid[:1000]`
|
25 |
+
- **Tokenized max length**: 512
|
26 |
+
- **Trained on**: Apple M3 Pro (MPS backend)
|
27 |
+
- **Epochs**: 1
|
28 |
+
- **Batch size**: 1 (with gradient accumulation)
|
29 |
+
|
30 |
+
## 💡 Example Usage
|
31 |
+
|
32 |
+
```python
|
33 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
34 |
+
from peft import PeftModel
|
35 |
+
|
36 |
+
base_model = "TinyLlama/TinyLlama-1.1B-Chat-v1.0"
|
37 |
+
adapter_model = "your-username/tinyllama-python-lora"
|
38 |
+
|
39 |
+
tokenizer = AutoTokenizer.from_pretrained(base_model)
|
40 |
+
model = AutoModelForCausalLM.from_pretrained(base_model)
|
41 |
+
model = PeftModel.from_pretrained(model, adapter_model)
|
42 |
+
|
43 |
+
prompt = "<|python|>\ndef fibonacci(n):"
|
44 |
+
inputs = tokenizer(prompt, return_tensors="pt")
|
45 |
+
outputs = model.generate(**inputs, max_new_tokens=100)
|
46 |
+
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
|
47 |
+
```
|
48 |
+
|
49 |
+
## 🧠 Intended Use
|
50 |
+
Code completion for Python
|
51 |
+
|
52 |
+
Teaching LLMs Python function structure
|
53 |
+
|
54 |
+
Experimentation with LoRA on small code datasets
|
55 |
+
|
56 |
+
##⚠️ Limitations
|
57 |
+
Trained on a small subset of data (1,000 samples)
|
58 |
+
|
59 |
+
May hallucinate or generate syntactically incorrect code
|
60 |
+
|
61 |
+
Not suitable for production use without further fine-tuning and evaluation
|
62 |
+
|
63 |
+
## 📜 License
|
64 |
+
Apache 2.0 — same as the base model.
|
adapter_config.json
ADDED
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"alpha_pattern": {},
|
3 |
+
"auto_mapping": null,
|
4 |
+
"base_model_name_or_path": "TinyLlama/TinyLlama-1.1B-Chat-v1.0",
|
5 |
+
"bias": "none",
|
6 |
+
"corda_config": null,
|
7 |
+
"eva_config": null,
|
8 |
+
"exclude_modules": null,
|
9 |
+
"fan_in_fan_out": false,
|
10 |
+
"inference_mode": true,
|
11 |
+
"init_lora_weights": true,
|
12 |
+
"layer_replication": null,
|
13 |
+
"layers_pattern": null,
|
14 |
+
"layers_to_transform": null,
|
15 |
+
"loftq_config": {},
|
16 |
+
"lora_alpha": 32,
|
17 |
+
"lora_bias": false,
|
18 |
+
"lora_dropout": 0.05,
|
19 |
+
"megatron_config": null,
|
20 |
+
"megatron_core": "megatron.core",
|
21 |
+
"modules_to_save": null,
|
22 |
+
"peft_type": "LORA",
|
23 |
+
"r": 8,
|
24 |
+
"rank_pattern": {},
|
25 |
+
"revision": null,
|
26 |
+
"target_modules": [
|
27 |
+
"q_proj",
|
28 |
+
"v_proj"
|
29 |
+
],
|
30 |
+
"task_type": "CAUSAL_LM",
|
31 |
+
"trainable_token_indices": null,
|
32 |
+
"use_dora": false,
|
33 |
+
"use_rslora": false
|
34 |
+
}
|
adapter_model.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:310bd71ed0899be4dac87a35511326c8beb432f40ae602dbc1a8dd19c9f0be79
|
3 |
+
size 4517152
|
checkpoint-250/README.md
ADDED
@@ -0,0 +1,202 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
base_model: TinyLlama/TinyLlama-1.1B-Chat-v1.0
|
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.15.2
|
checkpoint-250/adapter_config.json
ADDED
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"alpha_pattern": {},
|
3 |
+
"auto_mapping": null,
|
4 |
+
"base_model_name_or_path": "TinyLlama/TinyLlama-1.1B-Chat-v1.0",
|
5 |
+
"bias": "none",
|
6 |
+
"corda_config": null,
|
7 |
+
"eva_config": null,
|
8 |
+
"exclude_modules": null,
|
9 |
+
"fan_in_fan_out": false,
|
10 |
+
"inference_mode": true,
|
11 |
+
"init_lora_weights": true,
|
12 |
+
"layer_replication": null,
|
13 |
+
"layers_pattern": null,
|
14 |
+
"layers_to_transform": null,
|
15 |
+
"loftq_config": {},
|
16 |
+
"lora_alpha": 32,
|
17 |
+
"lora_bias": false,
|
18 |
+
"lora_dropout": 0.05,
|
19 |
+
"megatron_config": null,
|
20 |
+
"megatron_core": "megatron.core",
|
21 |
+
"modules_to_save": null,
|
22 |
+
"peft_type": "LORA",
|
23 |
+
"r": 8,
|
24 |
+
"rank_pattern": {},
|
25 |
+
"revision": null,
|
26 |
+
"target_modules": [
|
27 |
+
"q_proj",
|
28 |
+
"v_proj"
|
29 |
+
],
|
30 |
+
"task_type": "CAUSAL_LM",
|
31 |
+
"trainable_token_indices": null,
|
32 |
+
"use_dora": false,
|
33 |
+
"use_rslora": false
|
34 |
+
}
|
checkpoint-250/adapter_model.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:310bd71ed0899be4dac87a35511326c8beb432f40ae602dbc1a8dd19c9f0be79
|
3 |
+
size 4517152
|
checkpoint-250/optimizer.pt
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:6bc8a600505b95a31aa08489be280a34f1fc7586f3ff1f46118b142c03aebb6f
|
3 |
+
size 9083339
|
checkpoint-250/rng_state.pth
ADDED
Binary file (14.5 kB). View file
|
|
checkpoint-250/scheduler.pt
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:e572f39a80aa9526619aa6f27ddcf86ffb79e34deb116773468aa965b928ce6e
|
3 |
+
size 1465
|
checkpoint-250/special_tokens_map.json
ADDED
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"bos_token": {
|
3 |
+
"content": "<s>",
|
4 |
+
"lstrip": false,
|
5 |
+
"normalized": false,
|
6 |
+
"rstrip": false,
|
7 |
+
"single_word": false
|
8 |
+
},
|
9 |
+
"eos_token": {
|
10 |
+
"content": "</s>",
|
11 |
+
"lstrip": false,
|
12 |
+
"normalized": false,
|
13 |
+
"rstrip": false,
|
14 |
+
"single_word": false
|
15 |
+
},
|
16 |
+
"pad_token": {
|
17 |
+
"content": "</s>",
|
18 |
+
"lstrip": false,
|
19 |
+
"normalized": false,
|
20 |
+
"rstrip": false,
|
21 |
+
"single_word": false
|
22 |
+
},
|
23 |
+
"unk_token": {
|
24 |
+
"content": "<unk>",
|
25 |
+
"lstrip": false,
|
26 |
+
"normalized": false,
|
27 |
+
"rstrip": false,
|
28 |
+
"single_word": false
|
29 |
+
}
|
30 |
+
}
|
checkpoint-250/tokenizer.json
ADDED
The diff for this file is too large to render.
See raw diff
|
|
checkpoint-250/tokenizer_config.json
ADDED
@@ -0,0 +1,44 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"add_bos_token": true,
|
3 |
+
"add_eos_token": false,
|
4 |
+
"add_prefix_space": null,
|
5 |
+
"added_tokens_decoder": {
|
6 |
+
"0": {
|
7 |
+
"content": "<unk>",
|
8 |
+
"lstrip": false,
|
9 |
+
"normalized": false,
|
10 |
+
"rstrip": false,
|
11 |
+
"single_word": false,
|
12 |
+
"special": true
|
13 |
+
},
|
14 |
+
"1": {
|
15 |
+
"content": "<s>",
|
16 |
+
"lstrip": false,
|
17 |
+
"normalized": false,
|
18 |
+
"rstrip": false,
|
19 |
+
"single_word": false,
|
20 |
+
"special": true
|
21 |
+
},
|
22 |
+
"2": {
|
23 |
+
"content": "</s>",
|
24 |
+
"lstrip": false,
|
25 |
+
"normalized": false,
|
26 |
+
"rstrip": false,
|
27 |
+
"single_word": false,
|
28 |
+
"special": true
|
29 |
+
}
|
30 |
+
},
|
31 |
+
"bos_token": "<s>",
|
32 |
+
"chat_template": "{% for message in messages %}\n{% if message['role'] == 'user' %}\n{{ '<|user|>\n' + message['content'] + eos_token }}\n{% elif message['role'] == 'system' %}\n{{ '<|system|>\n' + message['content'] + eos_token }}\n{% elif message['role'] == 'assistant' %}\n{{ '<|assistant|>\n' + message['content'] + eos_token }}\n{% endif %}\n{% if loop.last and add_generation_prompt %}\n{{ '<|assistant|>' }}\n{% endif %}\n{% endfor %}",
|
33 |
+
"clean_up_tokenization_spaces": false,
|
34 |
+
"eos_token": "</s>",
|
35 |
+
"extra_special_tokens": {},
|
36 |
+
"legacy": false,
|
37 |
+
"model_max_length": 2048,
|
38 |
+
"pad_token": "</s>",
|
39 |
+
"padding_side": "right",
|
40 |
+
"sp_model_kwargs": {},
|
41 |
+
"tokenizer_class": "LlamaTokenizer",
|
42 |
+
"unk_token": "<unk>",
|
43 |
+
"use_default_system_prompt": false
|
44 |
+
}
|
checkpoint-250/trainer_state.json
ADDED
@@ -0,0 +1,209 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"best_global_step": null,
|
3 |
+
"best_metric": null,
|
4 |
+
"best_model_checkpoint": null,
|
5 |
+
"epoch": 1.0,
|
6 |
+
"eval_steps": 500,
|
7 |
+
"global_step": 250,
|
8 |
+
"is_hyper_param_search": false,
|
9 |
+
"is_local_process_zero": true,
|
10 |
+
"is_world_process_zero": true,
|
11 |
+
"log_history": [
|
12 |
+
{
|
13 |
+
"epoch": 0.04,
|
14 |
+
"grad_norm": 0.5616522431373596,
|
15 |
+
"learning_rate": 4.82e-05,
|
16 |
+
"loss": 1.1747,
|
17 |
+
"step": 10
|
18 |
+
},
|
19 |
+
{
|
20 |
+
"epoch": 0.08,
|
21 |
+
"grad_norm": 0.6579018831253052,
|
22 |
+
"learning_rate": 4.6200000000000005e-05,
|
23 |
+
"loss": 1.0469,
|
24 |
+
"step": 20
|
25 |
+
},
|
26 |
+
{
|
27 |
+
"epoch": 0.12,
|
28 |
+
"grad_norm": 0.7981964349746704,
|
29 |
+
"learning_rate": 4.4200000000000004e-05,
|
30 |
+
"loss": 1.0567,
|
31 |
+
"step": 30
|
32 |
+
},
|
33 |
+
{
|
34 |
+
"epoch": 0.16,
|
35 |
+
"grad_norm": 0.9774985909461975,
|
36 |
+
"learning_rate": 4.22e-05,
|
37 |
+
"loss": 0.9834,
|
38 |
+
"step": 40
|
39 |
+
},
|
40 |
+
{
|
41 |
+
"epoch": 0.2,
|
42 |
+
"grad_norm": 0.6699696779251099,
|
43 |
+
"learning_rate": 4.02e-05,
|
44 |
+
"loss": 1.033,
|
45 |
+
"step": 50
|
46 |
+
},
|
47 |
+
{
|
48 |
+
"epoch": 0.24,
|
49 |
+
"grad_norm": 0.7246522903442383,
|
50 |
+
"learning_rate": 3.82e-05,
|
51 |
+
"loss": 0.9588,
|
52 |
+
"step": 60
|
53 |
+
},
|
54 |
+
{
|
55 |
+
"epoch": 0.28,
|
56 |
+
"grad_norm": 0.6503073573112488,
|
57 |
+
"learning_rate": 3.62e-05,
|
58 |
+
"loss": 1.1316,
|
59 |
+
"step": 70
|
60 |
+
},
|
61 |
+
{
|
62 |
+
"epoch": 0.32,
|
63 |
+
"grad_norm": 0.7243292331695557,
|
64 |
+
"learning_rate": 3.4200000000000005e-05,
|
65 |
+
"loss": 1.105,
|
66 |
+
"step": 80
|
67 |
+
},
|
68 |
+
{
|
69 |
+
"epoch": 0.36,
|
70 |
+
"grad_norm": 0.6837774515151978,
|
71 |
+
"learning_rate": 3.2200000000000003e-05,
|
72 |
+
"loss": 1.0431,
|
73 |
+
"step": 90
|
74 |
+
},
|
75 |
+
{
|
76 |
+
"epoch": 0.4,
|
77 |
+
"grad_norm": 0.7276621460914612,
|
78 |
+
"learning_rate": 3.02e-05,
|
79 |
+
"loss": 1.0878,
|
80 |
+
"step": 100
|
81 |
+
},
|
82 |
+
{
|
83 |
+
"epoch": 0.44,
|
84 |
+
"grad_norm": 0.5852382183074951,
|
85 |
+
"learning_rate": 2.8199999999999998e-05,
|
86 |
+
"loss": 1.0713,
|
87 |
+
"step": 110
|
88 |
+
},
|
89 |
+
{
|
90 |
+
"epoch": 0.48,
|
91 |
+
"grad_norm": 0.6434891223907471,
|
92 |
+
"learning_rate": 2.6200000000000003e-05,
|
93 |
+
"loss": 1.0564,
|
94 |
+
"step": 120
|
95 |
+
},
|
96 |
+
{
|
97 |
+
"epoch": 0.52,
|
98 |
+
"grad_norm": 0.8133268356323242,
|
99 |
+
"learning_rate": 2.4200000000000002e-05,
|
100 |
+
"loss": 1.0184,
|
101 |
+
"step": 130
|
102 |
+
},
|
103 |
+
{
|
104 |
+
"epoch": 0.56,
|
105 |
+
"grad_norm": 0.6674674153327942,
|
106 |
+
"learning_rate": 2.22e-05,
|
107 |
+
"loss": 0.9579,
|
108 |
+
"step": 140
|
109 |
+
},
|
110 |
+
{
|
111 |
+
"epoch": 0.6,
|
112 |
+
"grad_norm": 0.7289815545082092,
|
113 |
+
"learning_rate": 2.0200000000000003e-05,
|
114 |
+
"loss": 1.0709,
|
115 |
+
"step": 150
|
116 |
+
},
|
117 |
+
{
|
118 |
+
"epoch": 0.64,
|
119 |
+
"grad_norm": 0.8111977577209473,
|
120 |
+
"learning_rate": 1.8200000000000002e-05,
|
121 |
+
"loss": 1.0948,
|
122 |
+
"step": 160
|
123 |
+
},
|
124 |
+
{
|
125 |
+
"epoch": 0.68,
|
126 |
+
"grad_norm": 0.822685182094574,
|
127 |
+
"learning_rate": 1.62e-05,
|
128 |
+
"loss": 1.0823,
|
129 |
+
"step": 170
|
130 |
+
},
|
131 |
+
{
|
132 |
+
"epoch": 0.72,
|
133 |
+
"grad_norm": 0.7154224514961243,
|
134 |
+
"learning_rate": 1.42e-05,
|
135 |
+
"loss": 0.9634,
|
136 |
+
"step": 180
|
137 |
+
},
|
138 |
+
{
|
139 |
+
"epoch": 0.76,
|
140 |
+
"grad_norm": 0.6793033480644226,
|
141 |
+
"learning_rate": 1.22e-05,
|
142 |
+
"loss": 0.9934,
|
143 |
+
"step": 190
|
144 |
+
},
|
145 |
+
{
|
146 |
+
"epoch": 0.8,
|
147 |
+
"grad_norm": 0.6630302667617798,
|
148 |
+
"learning_rate": 1.02e-05,
|
149 |
+
"loss": 0.9866,
|
150 |
+
"step": 200
|
151 |
+
},
|
152 |
+
{
|
153 |
+
"epoch": 0.84,
|
154 |
+
"grad_norm": 0.8769239187240601,
|
155 |
+
"learning_rate": 8.200000000000001e-06,
|
156 |
+
"loss": 0.8853,
|
157 |
+
"step": 210
|
158 |
+
},
|
159 |
+
{
|
160 |
+
"epoch": 0.88,
|
161 |
+
"grad_norm": 0.7216284275054932,
|
162 |
+
"learning_rate": 6.2e-06,
|
163 |
+
"loss": 0.9867,
|
164 |
+
"step": 220
|
165 |
+
},
|
166 |
+
{
|
167 |
+
"epoch": 0.92,
|
168 |
+
"grad_norm": 0.9310891032218933,
|
169 |
+
"learning_rate": 4.2000000000000004e-06,
|
170 |
+
"loss": 0.9694,
|
171 |
+
"step": 230
|
172 |
+
},
|
173 |
+
{
|
174 |
+
"epoch": 0.96,
|
175 |
+
"grad_norm": 0.816041111946106,
|
176 |
+
"learning_rate": 2.2e-06,
|
177 |
+
"loss": 0.9702,
|
178 |
+
"step": 240
|
179 |
+
},
|
180 |
+
{
|
181 |
+
"epoch": 1.0,
|
182 |
+
"grad_norm": 0.7796522974967957,
|
183 |
+
"learning_rate": 2.0000000000000002e-07,
|
184 |
+
"loss": 0.9702,
|
185 |
+
"step": 250
|
186 |
+
}
|
187 |
+
],
|
188 |
+
"logging_steps": 10,
|
189 |
+
"max_steps": 250,
|
190 |
+
"num_input_tokens_seen": 0,
|
191 |
+
"num_train_epochs": 1,
|
192 |
+
"save_steps": 500,
|
193 |
+
"stateful_callbacks": {
|
194 |
+
"TrainerControl": {
|
195 |
+
"args": {
|
196 |
+
"should_epoch_stop": false,
|
197 |
+
"should_evaluate": false,
|
198 |
+
"should_log": false,
|
199 |
+
"should_save": true,
|
200 |
+
"should_training_stop": true
|
201 |
+
},
|
202 |
+
"attributes": {}
|
203 |
+
}
|
204 |
+
},
|
205 |
+
"total_flos": 3181482344448000.0,
|
206 |
+
"train_batch_size": 1,
|
207 |
+
"trial_name": null,
|
208 |
+
"trial_params": null
|
209 |
+
}
|
checkpoint-250/training_args.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:1668bbc1f1fc959775f71a3a6538512e36af7ee1c47c951f0a1968b92cc525a5
|
3 |
+
size 5713
|
config.json
ADDED
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"architectures": [
|
3 |
+
"LlamaForCausalLM"
|
4 |
+
],
|
5 |
+
"attention_bias": false,
|
6 |
+
"bos_token_id": 1,
|
7 |
+
"eos_token_id": 2,
|
8 |
+
"hidden_act": "silu",
|
9 |
+
"hidden_size": 2048,
|
10 |
+
"initializer_range": 0.02,
|
11 |
+
"intermediate_size": 5632,
|
12 |
+
"max_position_embeddings": 2048,
|
13 |
+
"model_type": "llama",
|
14 |
+
"num_attention_heads": 32,
|
15 |
+
"num_hidden_layers": 22,
|
16 |
+
"num_key_value_heads": 4,
|
17 |
+
"pretraining_tp": 1,
|
18 |
+
"rms_norm_eps": 0.00001,
|
19 |
+
"rope_scaling": null,
|
20 |
+
"rope_theta": 10000,
|
21 |
+
"tie_word_embeddings": false,
|
22 |
+
"torch_dtype": "bfloat16",
|
23 |
+
"transformers_version": "4.35.0",
|
24 |
+
"use_cache": true,
|
25 |
+
"vocab_size": 32000
|
26 |
+
}
|
model_card.json
ADDED
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"language": "Python",
|
3 |
+
"license": "apache-2.0",
|
4 |
+
"library_name": "transformers",
|
5 |
+
"tags": [
|
6 |
+
"tinyllama",
|
7 |
+
"lora",
|
8 |
+
"peft",
|
9 |
+
"code",
|
10 |
+
"python",
|
11 |
+
"fine-tuning",
|
12 |
+
"mps"
|
13 |
+
],
|
14 |
+
"model_type": "causal-lm",
|
15 |
+
"pipeline_tag": "text-generation",
|
16 |
+
"base_model": "TinyLlama/TinyLlama-1.1B-Chat-v1.0",
|
17 |
+
"datasets": [
|
18 |
+
"codeparrot/codeparrot-clean-valid"
|
19 |
+
],
|
20 |
+
"trained_on": "Apple M3 Pro (MPS)",
|
21 |
+
"adapter_type": "lora",
|
22 |
+
"num_train_samples": 1000,
|
23 |
+
"num_epochs": 1,
|
24 |
+
"gradient_accumulation_steps": 4,
|
25 |
+
"per_device_batch_size": 1,
|
26 |
+
"prompt_format": "<|python|>\\n{code}",
|
27 |
+
"inference_prompt": "<|python|>\\ndef fibonacci(n):",
|
28 |
+
"example_output": "def fibonacci(n):\n if n <= 1:\n return n\n return fibonacci(n-1) + fibonacci(n-2)"
|
29 |
+
}
|
30 |
+
|
special_tokens_map.json
ADDED
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"bos_token": {
|
3 |
+
"content": "<s>",
|
4 |
+
"lstrip": false,
|
5 |
+
"normalized": false,
|
6 |
+
"rstrip": false,
|
7 |
+
"single_word": false
|
8 |
+
},
|
9 |
+
"eos_token": {
|
10 |
+
"content": "</s>",
|
11 |
+
"lstrip": false,
|
12 |
+
"normalized": false,
|
13 |
+
"rstrip": false,
|
14 |
+
"single_word": false
|
15 |
+
},
|
16 |
+
"pad_token": {
|
17 |
+
"content": "</s>",
|
18 |
+
"lstrip": false,
|
19 |
+
"normalized": false,
|
20 |
+
"rstrip": false,
|
21 |
+
"single_word": false
|
22 |
+
},
|
23 |
+
"unk_token": {
|
24 |
+
"content": "<unk>",
|
25 |
+
"lstrip": false,
|
26 |
+
"normalized": false,
|
27 |
+
"rstrip": false,
|
28 |
+
"single_word": false
|
29 |
+
}
|
30 |
+
}
|
tokenizer.json
ADDED
The diff for this file is too large to render.
See raw diff
|
|
tokenizer_config.json
ADDED
@@ -0,0 +1,44 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"add_bos_token": true,
|
3 |
+
"add_eos_token": false,
|
4 |
+
"add_prefix_space": null,
|
5 |
+
"added_tokens_decoder": {
|
6 |
+
"0": {
|
7 |
+
"content": "<unk>",
|
8 |
+
"lstrip": false,
|
9 |
+
"normalized": false,
|
10 |
+
"rstrip": false,
|
11 |
+
"single_word": false,
|
12 |
+
"special": true
|
13 |
+
},
|
14 |
+
"1": {
|
15 |
+
"content": "<s>",
|
16 |
+
"lstrip": false,
|
17 |
+
"normalized": false,
|
18 |
+
"rstrip": false,
|
19 |
+
"single_word": false,
|
20 |
+
"special": true
|
21 |
+
},
|
22 |
+
"2": {
|
23 |
+
"content": "</s>",
|
24 |
+
"lstrip": false,
|
25 |
+
"normalized": false,
|
26 |
+
"rstrip": false,
|
27 |
+
"single_word": false,
|
28 |
+
"special": true
|
29 |
+
}
|
30 |
+
},
|
31 |
+
"bos_token": "<s>",
|
32 |
+
"chat_template": "{% for message in messages %}\n{% if message['role'] == 'user' %}\n{{ '<|user|>\n' + message['content'] + eos_token }}\n{% elif message['role'] == 'system' %}\n{{ '<|system|>\n' + message['content'] + eos_token }}\n{% elif message['role'] == 'assistant' %}\n{{ '<|assistant|>\n' + message['content'] + eos_token }}\n{% endif %}\n{% if loop.last and add_generation_prompt %}\n{{ '<|assistant|>' }}\n{% endif %}\n{% endfor %}",
|
33 |
+
"clean_up_tokenization_spaces": false,
|
34 |
+
"eos_token": "</s>",
|
35 |
+
"extra_special_tokens": {},
|
36 |
+
"legacy": false,
|
37 |
+
"model_max_length": 2048,
|
38 |
+
"pad_token": "</s>",
|
39 |
+
"padding_side": "right",
|
40 |
+
"sp_model_kwargs": {},
|
41 |
+
"tokenizer_class": "LlamaTokenizer",
|
42 |
+
"unk_token": "<unk>",
|
43 |
+
"use_default_system_prompt": false
|
44 |
+
}
|