Upload model
Browse files- README.md +140 -163
- adapter_config.json +5 -3
- adapter_model.safetensors +2 -2
README.md
CHANGED
@@ -1,231 +1,208 @@
|
|
1 |
---
|
2 |
-
license: llama2
|
3 |
library_name: peft
|
4 |
-
tags:
|
5 |
-
- llama-2
|
6 |
-
datasets:
|
7 |
-
- ehartford/dolphin
|
8 |
-
inference: false
|
9 |
-
pipeline_tag: text-generation
|
10 |
base_model: meta-llama/Llama-2-13b-hf
|
11 |
---
|
12 |
|
13 |
-
|
14 |
|
15 |
-
|
16 |
|
17 |
-
</div>
|
18 |
|
19 |
-
# Llama-2-13B-Instruct-v0.1
|
20 |
|
21 |
-
|
22 |
|
23 |
-
|
24 |
|
25 |
-
|
26 |
-
|-----------------------|-------|
|
27 |
-
| MMLU (5-shot) | 55.76 |
|
28 |
-
| ARC (25-shot) | 59.98 |
|
29 |
-
| HellaSwag (10-shot) | 82.43 |
|
30 |
-
| TruthfulQA (0-shot) | 42.59 |
|
31 |
-
| Avg. | 60.19 |
|
32 |
|
33 |
-
We use state-of-the-art [Language Model Evaluation Harness](https://github.com/EleutherAI/lm-evaluation-harness) to run the benchmark tests above, using the same version as Hugging Face's [Open LLM Leaderboard](https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard).
|
34 |
|
35 |
-
## Helpful Links
|
36 |
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
|
|
|
|
42 |
|
43 |
-
|
44 |
|
45 |
-
|
46 |
|
47 |
-
**
|
48 |
-
|
|
|
49 |
|
50 |
-
|
51 |
|
52 |
-
|
53 |
-
> 2. Take a stroll through Central Park and enjoy its many attractions.
|
54 |
-
> 3. Explore the world-renowned museums, such as the Metropolitan Museum of Art and the Museum of Modern Art.
|
55 |
-
> 4. Experience the vibrant energy of Times Square and take in the bright lights and billboards.
|
56 |
-
> 5. Visit the 9/11 Memorial and Museum to pay tribute to those who lost their lives in the attacks.
|
57 |
-
> 6. Enjoy a Broadway show or a concert at one of the many theaters and venues in the city.
|
58 |
-
> 7. Take a ride on the Staten Island Ferry for a free view of the Statue of Liberty and the New York City skyline.
|
59 |
-
> 8. Shop at the famous Fifth Avenue stores and explore the high-end boutiques.
|
60 |
-
> 9. Indulge in a variety of cuisines at one of the many restaurants in the city.
|
61 |
-
> 10. Visit the Empire State Building and enjoy the panoramic views of the city from the observation deck.
|
62 |
|
63 |
-
|
64 |
|
65 |
-
|
66 |
|
67 |
-
|
68 |
-
>You are a helpful assistant. Write a short email inviting my friends to a dinner party on Friday. Respond succinctly.\n"
|
69 |
|
70 |
-
|
71 |
|
72 |
-
|
73 |
-
>
|
74 |
-
> Dear Friends,
|
75 |
-
>
|
76 |
-
> I hope this email finds you well. I'm excited to invite you all to a dinner party on Friday, March 10th, at 7:00 PM. The address is 123 Main Street, Anytown, USA.
|
77 |
-
>
|
78 |
-
> Please RSVP by Wednesday, March 8th, so I can plan accordingly. I look forward to seeing you all and sharing a delicious meal together!
|
79 |
-
>
|
80 |
-
> Best,
|
81 |
-
> Your Friendly Assistant
|
82 |
-
>
|
83 |
-
> P.S. If you have any dietary restrictions or allergies, please let me know in your RSVP. Thank you!
|
84 |
|
85 |
-
|
86 |
|
87 |
-
|
88 |
|
89 |
-
|
90 |
|
91 |
-
|
92 |
-
* It uses the [SwiGLU activation function](https://arxiv.org/abs/2002.05202)
|
93 |
-
* It uses [rotary positional embeddings](https://arxiv.org/abs/2104.09864) (RoPE)
|
94 |
|
95 |
-
|
96 |
-
|----------------|-------|
|
97 |
-
| n_parameters | 13B |
|
98 |
-
| tokens | 2.0T |
|
99 |
-
| vocab size | 32000 |
|
100 |
-
| sequence length | 4096 |
|
101 |
|
102 |
-
|
103 |
|
104 |
-
|
105 |
|
106 |
-
|
107 |
|
108 |
-
|
109 |
|
110 |
-
|
111 |
|
112 |
-
|
113 |
|
114 |
-
|
115 |
|
116 |
-
|
117 |
|
118 |
-
|
119 |
|
120 |
-
|
121 |
-
This model was trained on various public datasets.
|
122 |
-
While great efforts have been taken to clean the pretraining data, it is possible that this model could generate lewd, biased or otherwise offensive outputs.
|
123 |
|
124 |
-
|
125 |
|
126 |
-
|
127 |
|
128 |
-
|
129 |
-
!pip install -q -U huggingface_hub peft transformers torch accelerate
|
130 |
-
```
|
131 |
|
132 |
-
|
133 |
-
from huggingface_hub import notebook_login
|
134 |
-
import torch
|
135 |
-
from peft import PeftModel, PeftConfig
|
136 |
-
from transformers import (
|
137 |
-
AutoModelForCausalLM,
|
138 |
-
AutoTokenizer,
|
139 |
-
BitsAndBytesConfig,
|
140 |
-
pipeline,
|
141 |
-
)
|
142 |
|
143 |
-
|
144 |
-
```
|
145 |
|
146 |
-
|
147 |
-
peft_model_id = "dfurman/Llama-2-13B-Instruct-v0.1-peft"
|
148 |
-
config = PeftConfig.from_pretrained(peft_model_id)
|
149 |
|
150 |
-
bnb_config = BitsAndBytesConfig(
|
151 |
-
load_in_4bit=True,
|
152 |
-
bnb_4bit_quant_type="nf4",
|
153 |
-
bnb_4bit_compute_dtype=torch.bfloat16,
|
154 |
-
)
|
155 |
|
156 |
-
|
157 |
-
config.base_model_name_or_path,
|
158 |
-
quantization_config=bnb_config,
|
159 |
-
use_auth_token=True,
|
160 |
-
device_map="auto",
|
161 |
-
)
|
162 |
|
163 |
-
|
164 |
-
tokenizer.pad_token = tokenizer.eos_token
|
165 |
|
166 |
-
|
167 |
|
168 |
-
|
169 |
-
```
|
170 |
|
171 |
-
|
172 |
-
# First, format the prompt
|
173 |
-
query = "Tell me a recipe for vegan banana bread."
|
174 |
-
prompt = format_template.format(query=query)
|
175 |
|
176 |
-
|
177 |
-
print("\n\n*** Generate:")
|
178 |
|
179 |
-
|
180 |
-
with torch.autocast("cuda", dtype=torch.bfloat16):
|
181 |
-
output = model.generate(
|
182 |
-
input_ids=input_ids,
|
183 |
-
max_new_tokens=512,
|
184 |
-
do_sample=True,
|
185 |
-
temperature=0.7,
|
186 |
-
return_dict_in_generate=True,
|
187 |
-
eos_token_id=tokenizer.eos_token_id,
|
188 |
-
pad_token_id=tokenizer.pad_token_id,
|
189 |
-
repetition_penalty=1.2,
|
190 |
-
)
|
191 |
|
192 |
-
|
193 |
-
```
|
194 |
|
195 |
-
|
196 |
|
|
|
197 |
|
198 |
-
|
199 |
-
|:-----------------------------:|:----------------------:|:---------------------:|:-------------:|:-----------------------:|
|
200 |
-
| 2.93 | 1x A100 (40 GB SXM) | torch | bfloat16 | 25 |
|
201 |
-
| 3.24 | 1x A6000 (48 GB) | torch | bfloat16 | 25 |
|
202 |
|
203 |
-
|
204 |
|
205 |
-
|
206 |
|
207 |
-
|
208 |
|
209 |
-
|
210 |
|
211 |
-
|
212 |
|
213 |
-
|
214 |
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
225 |
|
226 |
-
---
|
227 |
|
228 |
-
|
229 |
|
230 |
|
231 |
-
- PEFT 0.
|
|
|
1 |
---
|
|
|
2 |
library_name: peft
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
base_model: meta-llama/Llama-2-13b-hf
|
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 |
+
|
201 |
+
|
202 |
+
## Training procedure
|
203 |
|
|
|
204 |
|
205 |
+
### Framework versions
|
206 |
|
207 |
|
208 |
+
- PEFT 0.6.3.dev0
|
adapter_config.json
CHANGED
@@ -1,4 +1,5 @@
|
|
1 |
{
|
|
|
2 |
"auto_mapping": null,
|
3 |
"base_model_name_or_path": "meta-llama/Llama-2-13b-hf",
|
4 |
"bias": "none",
|
@@ -12,12 +13,13 @@
|
|
12 |
"modules_to_save": null,
|
13 |
"peft_type": "LORA",
|
14 |
"r": 64,
|
|
|
15 |
"revision": null,
|
16 |
"target_modules": [
|
17 |
-
"q_proj",
|
18 |
"k_proj",
|
19 |
-
"
|
20 |
-
"o_proj"
|
|
|
21 |
],
|
22 |
"task_type": "CAUSAL_LM"
|
23 |
}
|
|
|
1 |
{
|
2 |
+
"alpha_pattern": {},
|
3 |
"auto_mapping": null,
|
4 |
"base_model_name_or_path": "meta-llama/Llama-2-13b-hf",
|
5 |
"bias": "none",
|
|
|
13 |
"modules_to_save": null,
|
14 |
"peft_type": "LORA",
|
15 |
"r": 64,
|
16 |
+
"rank_pattern": {},
|
17 |
"revision": null,
|
18 |
"target_modules": [
|
|
|
19 |
"k_proj",
|
20 |
+
"q_proj",
|
21 |
+
"o_proj",
|
22 |
+
"v_proj"
|
23 |
],
|
24 |
"task_type": "CAUSAL_LM"
|
25 |
}
|
adapter_model.safetensors
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:809dc32759bbcaeae54c5098d86a1b5aded6b46875245adbf85f8c59a7cecbea
|
3 |
+
size 209758976
|