Upload lora files
Browse files- README.md +121 -59
- adapter_config.json +31 -0
- adapter_model.safetensors +3 -0
- runs/Apr16_01-04-30_nora-linux/events.out.tfevents.1713254671.nora-linux.1279622.0 +3 -0
- training_log.json +16 -0
- training_parameters.json +37 -0
- training_prompt.json +3 -0
README.md
CHANGED
@@ -1,89 +1,87 @@
|
|
1 |
---
|
2 |
-
language:
|
3 |
-
- en
|
4 |
library_name: peft
|
5 |
-
|
6 |
-
tags:
|
7 |
-
- education
|
8 |
---
|
9 |
-
# mistralai_Mistral-7B-Instruct-v0_2_student_answer_train_examples_mistral_0416
|
10 |
-
* LoRAs weights for Mistral-7b-Instruct-v0_2
|
11 |
|
12 |
-
#
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
|
17 |
-
* old training prompt: "Teenager students write in simple sentences [with typos and grammar errors].
|
18 |
-
You are a teenager student, and please answer the following question. {training example}"
|
19 |
|
20 |
## Model Details
|
21 |
-
|
22 |
-
|
|
|
|
|
|
|
23 |
|
24 |
|
25 |
-
- **Developed by:**
|
26 |
-
- **
|
|
|
|
|
|
|
|
|
|
|
27 |
|
28 |
-
###
|
|
|
|
|
29 |
|
30 |
- **Repository:** [More Information Needed]
|
31 |
- **Paper [optional]:** [More Information Needed]
|
32 |
- **Demo [optional]:** [More Information Needed]
|
33 |
|
34 |
-
##
|
35 |
-
|
36 |
-
|
37 |
-
from peft import PeftModel # for fine-tuning
|
38 |
-
from transformers import AutoModelForCausalLM, AutoTokenizer, pipeline, GenerationConfig, GPTQConfig, BitsAndBytesConfig
|
39 |
-
|
40 |
-
model_name_or_path = "mistralai/Mistral-7B-Instruct-v0.2"
|
41 |
-
nf4_config = BitsAndBytesConfig( # quantization 4-bit
|
42 |
-
load_in_4bit=True,
|
43 |
-
bnb_4bit_quant_type="nf4",
|
44 |
-
bnb_4bit_use_double_quant=True,
|
45 |
-
bnb_4bit_compute_dtype=torch.bfloat16
|
46 |
-
)
|
47 |
-
model = AutoModelForCausalLM.from_pretrained(model_name_or_path,
|
48 |
-
device_map="auto",
|
49 |
-
trust_remote_code=False,
|
50 |
-
quantization_config=nf4_config,
|
51 |
-
revision="main")
|
52 |
-
|
53 |
-
tokenizer = AutoTokenizer.from_pretrained(model_name_or_path, use_fast=True)
|
54 |
-
```
|
55 |
-
|
56 |
-
2. Load in LoRA weights:
|
57 |
-
```
|
58 |
-
lora_model_path = "{path_to_loras_folder}/mistralai_Mistral-7B-Instruct-v0.2-testgen-LoRAs" # load loras
|
59 |
-
model = PeftModel.from_pretrained(
|
60 |
-
model, lora_model_path, torch_dtype=torch.float16, force_download=True,
|
61 |
-
)
|
62 |
-
|
63 |
-
```
|
64 |
|
65 |
### Direct Use
|
66 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
67 |
### Recommendations
|
68 |
|
69 |
<!-- This section is meant to convey recommendations with respect to the bias, risk, and technical limitations. -->
|
70 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
71 |
|
72 |
-
## Training
|
73 |
-
* LoRA Rank: 128
|
74 |
-
* LoRA Alpha: 32
|
75 |
-
* Batch Size: 64
|
76 |
-
* Cutoff Length: 256
|
77 |
-
* Learning rate: 3e-4
|
78 |
-
* Epochs: 3
|
79 |
-
* LoRA Dropout: 0.05
|
80 |
|
81 |
### Training Data
|
82 |
-
|
|
|
83 |
|
84 |
[More Information Needed]
|
85 |
|
86 |
-
### Training Procedure
|
87 |
|
88 |
<!-- This relates heavily to the Technical Specifications. Content here should link to that section when it is relevant to the training procedure. -->
|
89 |
|
@@ -108,6 +106,18 @@ Trained on raw text file
|
|
108 |
|
109 |
### Testing Data, Factors & Metrics
|
110 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
111 |
#### Metrics
|
112 |
|
113 |
<!-- These are the evaluation metrics being used, ideally with a description of why. -->
|
@@ -118,12 +128,37 @@ Trained on raw text file
|
|
118 |
|
119 |
[More Information Needed]
|
120 |
|
|
|
|
|
|
|
|
|
121 |
## Model Examination [optional]
|
122 |
|
123 |
<!-- Relevant interpretability work for the model goes here -->
|
124 |
|
125 |
[More Information Needed]
|
126 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
127 |
|
128 |
#### Hardware
|
129 |
|
@@ -137,6 +172,33 @@ Trained on raw text file
|
|
137 |
|
138 |
<!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. -->
|
139 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
140 |
## Model Card Contact
|
141 |
|
142 |
-
[More Information Needed]
|
|
|
|
|
|
|
|
|
|
|
|
1 |
---
|
|
|
|
|
2 |
library_name: peft
|
3 |
+
base_model: models/mistralai_Mistral-7B-Instruct-v0.2
|
|
|
|
|
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 |
|
|
|
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. -->
|
|
|
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 |
|
|
|
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 |
+
|
201 |
+
|
202 |
+
### Framework versions
|
203 |
+
|
204 |
+
- PEFT 0.7.1
|
adapter_config.json
ADDED
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"alpha_pattern": {},
|
3 |
+
"auto_mapping": null,
|
4 |
+
"base_model_name_or_path": "models/mistralai_Mistral-7B-Instruct-v0.2",
|
5 |
+
"bias": "none",
|
6 |
+
"fan_in_fan_out": false,
|
7 |
+
"inference_mode": true,
|
8 |
+
"init_lora_weights": true,
|
9 |
+
"layers_pattern": null,
|
10 |
+
"layers_to_transform": null,
|
11 |
+
"loftq_config": {},
|
12 |
+
"lora_alpha": 32,
|
13 |
+
"lora_dropout": 0.05,
|
14 |
+
"megatron_config": null,
|
15 |
+
"megatron_core": "megatron.core",
|
16 |
+
"modules_to_save": null,
|
17 |
+
"peft_type": "LORA",
|
18 |
+
"r": 128,
|
19 |
+
"rank_pattern": {},
|
20 |
+
"revision": null,
|
21 |
+
"target_modules": [
|
22 |
+
"v_proj",
|
23 |
+
"q_proj",
|
24 |
+
"gate_proj",
|
25 |
+
"up_proj",
|
26 |
+
"down_proj",
|
27 |
+
"o_proj",
|
28 |
+
"k_proj"
|
29 |
+
],
|
30 |
+
"task_type": "CAUSAL_LM"
|
31 |
+
}
|
adapter_model.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:47241482acd7bfd8d36cdbb654565b345d940569a2ebeb1153a9e2a14d64f474
|
3 |
+
size 1342238560
|
runs/Apr16_01-04-30_nora-linux/events.out.tfevents.1713254671.nora-linux.1279622.0
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:9c4119628ec5fc228d06c7f12c104c8cb2d69177170d5ebff2836888088a9344
|
3 |
+
size 12913
|
training_log.json
ADDED
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"base_model_name": "None",
|
3 |
+
"base_model_class": "MistralForCausalLM",
|
4 |
+
"base_loaded_in_4bit": false,
|
5 |
+
"base_loaded_in_8bit": false,
|
6 |
+
"projections": "gate, down, up, q, v, k, o",
|
7 |
+
"loss": 0.118,
|
8 |
+
"learning_rate": 1.195219123505976e-06,
|
9 |
+
"epoch": 3.0,
|
10 |
+
"current_steps": 8155,
|
11 |
+
"train_runtime": 1400.5631,
|
12 |
+
"train_samples_per_second": 11.659,
|
13 |
+
"train_steps_per_second": 0.182,
|
14 |
+
"total_flos": 1.8663500338220237e+17,
|
15 |
+
"train_loss": 0.2664371884336659
|
16 |
+
}
|
training_parameters.json
ADDED
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"lora_name": "mistralai_Mistral-7B-Instruct-v0_2_student_answer_train_examples_mistral_0416_rank_128_epoch_3",
|
3 |
+
"always_override": true,
|
4 |
+
"q_proj_en": true,
|
5 |
+
"v_proj_en": true,
|
6 |
+
"k_proj_en": true,
|
7 |
+
"o_proj_en": true,
|
8 |
+
"gate_proj_en": true,
|
9 |
+
"down_proj_en": true,
|
10 |
+
"up_proj_en": true,
|
11 |
+
"save_steps": 0.0,
|
12 |
+
"micro_batch_size": 2,
|
13 |
+
"batch_size": 64,
|
14 |
+
"epochs": 3.0,
|
15 |
+
"learning_rate": "3e-4",
|
16 |
+
"lr_scheduler_type": "linear",
|
17 |
+
"lora_rank": 128,
|
18 |
+
"lora_alpha": 32,
|
19 |
+
"lora_dropout": 0.05,
|
20 |
+
"cutoff_len": 256,
|
21 |
+
"dataset": "None",
|
22 |
+
"eval_dataset": "None",
|
23 |
+
"format": "None",
|
24 |
+
"eval_steps": 100.0,
|
25 |
+
"raw_text_file": "student_answer_train_examples_mistral_0416",
|
26 |
+
"overlap_len": 128,
|
27 |
+
"newline_favor_len": 128,
|
28 |
+
"higher_rank_limit": false,
|
29 |
+
"warmup_steps": 100.0,
|
30 |
+
"optimizer": "adamw_bnb_8bit",
|
31 |
+
"hard_cut_string": "\\n\\n\\n",
|
32 |
+
"train_only_after": "",
|
33 |
+
"stop_at_loss": 0,
|
34 |
+
"add_eos_token": false,
|
35 |
+
"min_chars": 0.0,
|
36 |
+
"report_to": "None"
|
37 |
+
}
|
training_prompt.json
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"template_type": "raw_text"
|
3 |
+
}
|