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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
library_name: peft
|
| 3 |
+
base_model: mistralai/Mistral-7B-v0.1
|
| 4 |
+
language:
|
| 5 |
+
- en
|
| 6 |
+
pipeline_tag: text-generation
|
| 7 |
+
widget:
|
| 8 |
+
- text: "How many helicopters can a human eat in one sitting?"
|
| 9 |
+
tags:
|
| 10 |
+
- Δ
|
| 11 |
+
- LoRA
|
| 12 |
+
---
|
| 13 |
+
|
| 14 |
+
<!--
|
| 15 |
+
# Model Card for Model ID
|
| 16 |
+
-->
|
| 17 |
+
|
| 18 |
+
## Model Details
|
| 19 |
+
|
| 20 |
+
<!---->
|
| 21 |
+
$$
|
| 22 |
+
W_{mistral} + LoRA_{zephyr} = W_{zephyr} \\
|
| 23 |
+
W_{zephyr} - LoRA_{zephyr} = W_{mistral}
|
| 24 |
+
$$
|
| 25 |
+
|
| 26 |
+
<!--
|
| 27 |
+
$$ W_{mistral} + LoRA_{zephyr} = W_{zephyr} $$
|
| 28 |
+
```
|
| 29 |
+
typeof/zephyr-7b-beta-lora + mistralai/Mistral-7B-v0.1
|
| 30 |
+
= HuggingFaceH4/zephyr-7b-beta
|
| 31 |
+
````
|
| 32 |
+
|
| 33 |
+
### Model Description
|
| 34 |
+
|
| 35 |
+
- **Developed by:** [More Information Needed]
|
| 36 |
+
- **Funded by [optional]:** [More Information Needed]
|
| 37 |
+
- **Shared by [optional]:** [More Information Needed]
|
| 38 |
+
- **Model type:** [More Information Needed]
|
| 39 |
+
- **Language(s) (NLP):** [More Information Needed]
|
| 40 |
+
- **License:** [More Information Needed]
|
| 41 |
+
- **Finetuned from model [optional]:** [More Information Needed]
|
| 42 |
+
|
| 43 |
+
|
| 44 |
+
### Model Sources [optional]
|
| 45 |
+
|
| 46 |
+
- **Repository:** [More Information Needed]
|
| 47 |
+
- **Paper [optional]:** [More Information Needed]
|
| 48 |
+
- **Demo [optional]:** [More Information Needed]
|
| 49 |
+
|
| 50 |
+
## Uses
|
| 51 |
+
|
| 52 |
+
### Direct Use
|
| 53 |
+
|
| 54 |
+
[More Information Needed]
|
| 55 |
+
|
| 56 |
+
### Downstream Use [optional]
|
| 57 |
+
|
| 58 |
+
[More Information Needed]
|
| 59 |
+
|
| 60 |
+
### Out-of-Scope Use
|
| 61 |
+
|
| 62 |
+
[More Information Needed]
|
| 63 |
+
|
| 64 |
+
## Bias, Risks, and Limitations
|
| 65 |
+
|
| 66 |
+
[More Information Needed]
|
| 67 |
+
|
| 68 |
+
### Recommendations
|
| 69 |
+
|
| 70 |
+
Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations.
|
| 71 |
+
-->
|
| 72 |
+
|
| 73 |
+
### Model Sources
|
| 74 |
+
[HuggingFaceH4/zephyr-7b-beta](https://huggingface.co/HuggingFaceH4/zephyr-7b-beta)
|
| 75 |
+
|
| 76 |
+
## How to Get Started with the Model
|
| 77 |
+
|
| 78 |
+
Use the code below to get started with the model.
|
| 79 |
+
|
| 80 |
+
```python
|
| 81 |
+
# pip install transformers peft
|
| 82 |
+
|
| 83 |
+
import torch
|
| 84 |
+
from transformers import pipeline, AutoModelForCausalLM, AutoTokenizer
|
| 85 |
+
|
| 86 |
+
model_id = "mistralai/Mistral-7B-v0.1"
|
| 87 |
+
peft_model_id = "typeof/zephyr-7b-beta-lora"
|
| 88 |
+
|
| 89 |
+
model = AutoModelForCausalLM.from_pretrained(model_id)
|
| 90 |
+
model.load_adapter(peft_model_id)
|
| 91 |
+
|
| 92 |
+
tokenizer_id = "HuggingFaceH4/zephyr-7b-beta" # for chat template etc...
|
| 93 |
+
tokenizer = AutoTokenizer.from_pretrained(tokenizer_id)
|
| 94 |
+
|
| 95 |
+
pipe = pipeline("text-generation", model=model, tokenizer=tokenizer)
|
| 96 |
+
|
| 97 |
+
messages = [
|
| 98 |
+
{
|
| 99 |
+
"role": "system",
|
| 100 |
+
"content": "You are a friendly chatbot who always responds in the style of a pirate",
|
| 101 |
+
},
|
| 102 |
+
{"role": "user", "content": "How many helicopters can a human eat in one sitting?"},
|
| 103 |
+
]
|
| 104 |
+
prompt = pipe.tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
|
| 105 |
+
outputs = pipe(prompt, max_new_tokens=256, do_sample=True, temperature=0.7, top_k=50, top_p=0.95)
|
| 106 |
+
print(outputs[0]["generated_text"])
|
| 107 |
+
```
|
| 108 |
+
```
|
| 109 |
+
<|system|>
|
| 110 |
+
You are a friendly chatbot who always responds in the style of a pirate</s>
|
| 111 |
+
<|user|>
|
| 112 |
+
How many helicopters can a human eat in one sitting?</s>
|
| 113 |
+
<|assistant|>
|
| 114 |
+
Well, me matey, that’s a good question indeed! I’ve never seen
|
| 115 |
+
a human eat a helicopter, and I don’t think many others have
|
| 116 |
+
either. However, I’ve heard rumors that some people have
|
| 117 |
+
eaten entire airplanes, so I suppose it’s not entirely unheard
|
| 118 |
+
of.
|
| 119 |
+
|
| 120 |
+
As for the number of helicopters one could eat, that depends
|
| 121 |
+
on the size and weight of the helicopter. A small, lightweight
|
| 122 |
+
helicopter would be easier to eat than a large, heavy one.
|
| 123 |
+
In fact, I’ve heard that some people have eaten entire helicopters
|
| 124 |
+
as part of a dare or a challenge.
|
| 125 |
+
|
| 126 |
+
So, my advice to you, me hearty, is to steer clear of helicopters
|
| 127 |
+
and stick to more traditional fare. Yarr!</s>
|
| 128 |
+
```
|
| 129 |
+
<!--
|
| 130 |
+
|
| 131 |
+
## Training Details
|
| 132 |
+
|
| 133 |
+
### Training Data
|
| 134 |
+
|
| 135 |
+
|
| 136 |
+
[More Information Needed]
|
| 137 |
+
|
| 138 |
+
### Training Procedure
|
| 139 |
+
|
| 140 |
+
|
| 141 |
+
#### Preprocessing [optional]
|
| 142 |
+
|
| 143 |
+
[More Information Needed]
|
| 144 |
+
|
| 145 |
+
|
| 146 |
+
#### Training Hyperparameters
|
| 147 |
+
|
| 148 |
+
#### Speeds, Sizes, Times [optional]
|
| 149 |
+
|
| 150 |
+
|
| 151 |
+
[More Information Needed]
|
| 152 |
+
|
| 153 |
+
## Evaluation
|
| 154 |
+
|
| 155 |
+
|
| 156 |
+
### Testing Data, Factors & Metrics
|
| 157 |
+
|
| 158 |
+
#### Testing Data
|
| 159 |
+
|
| 160 |
+
|
| 161 |
+
[More Information Needed]
|
| 162 |
+
|
| 163 |
+
#### Factors
|
| 164 |
+
|
| 165 |
+
|
| 166 |
+
[More Information Needed]
|
| 167 |
+
|
| 168 |
+
#### Metrics
|
| 169 |
+
|
| 170 |
+
|
| 171 |
+
[More Information Needed]
|
| 172 |
+
|
| 173 |
+
### Results
|
| 174 |
+
|
| 175 |
+
[More Information Needed]
|
| 176 |
+
|
| 177 |
+
#### Summary
|
| 178 |
+
|
| 179 |
+
## Model Examination [optional]
|
| 180 |
+
|
| 181 |
+
[More Information Needed]
|
| 182 |
+
|
| 183 |
+
## Technical Specifications [optional]
|
| 184 |
+
|
| 185 |
+
### Model Architecture and Objective
|
| 186 |
+
|
| 187 |
+
[More Information Needed]
|
| 188 |
+
|
| 189 |
+
### Compute Infrastructure
|
| 190 |
+
|
| 191 |
+
[More Information Needed]
|
| 192 |
+
|
| 193 |
+
#### Hardware
|
| 194 |
+
|
| 195 |
+
[More Information Needed]
|
| 196 |
+
|
| 197 |
+
#### Software
|
| 198 |
+
|
| 199 |
+
[More Information Needed]
|
| 200 |
+
|
| 201 |
+
## Citation [optional]
|
| 202 |
+
|
| 203 |
+
**BibTeX:**
|
| 204 |
+
|
| 205 |
+
[More Information Needed]
|
| 206 |
+
|
| 207 |
+
**APA:**
|
| 208 |
+
|
| 209 |
+
[More Information Needed]
|
| 210 |
+
|
| 211 |
+
## Glossary [optional]
|
| 212 |
+
|
| 213 |
+
[More Information Needed]
|
| 214 |
+
|
| 215 |
+
## More Information
|
| 216 |
+
|
| 217 |
+
[More Information Needed]
|
| 218 |
+
|
| 219 |
+
## Model Card Authors [optional]
|
| 220 |
+
|
| 221 |
+
[More Information Needed]
|
| 222 |
+
|
| 223 |
+
## Model Card Contact
|
| 224 |
+
|
| 225 |
+
[More Information Needed]
|
| 226 |
+
|
| 227 |
+
## Training procedure
|
| 228 |
+
|
| 229 |
+
The following `bitsandbytes` quantization config was used during training:
|
| 230 |
+
- quant_method: bitsandbytes
|
| 231 |
+
- load_in_4bit: True
|
| 232 |
+
- bnb_4bit_quant_type: nf4
|
| 233 |
+
- bnb_4bit_use_double_quant: True
|
| 234 |
+
|
| 235 |
+
### Framework versions
|
| 236 |
+
|
| 237 |
+
- PEFT 0.6.3.dev0
|
| 238 |
+
|
| 239 |
+
-->
|
| 240 |
+
#### Summary
|
| 241 |
+
|
| 242 |
+
[Zephyr-7B-β](https://arxiv.org/abs/2305.18290) is a fine-tuned version of [mistralai/Mistral-7B-v0.1](https://huggingface.co/mistralai/Mistral-7B-v0.1)
|
| 243 |
+
[Zephyr-7B technical report](https://arxiv.org/abs/2310.16944)
|
| 244 |
+
|
| 245 |
+
[LoRA](https://arxiv.org/abs/2305.14314)
|
| 246 |
+
[QLoRA](https://arxiv.org/abs/2106.09685)
|
adapter_config.json
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"alpha_pattern": {},
|
| 3 |
+
"auto_mapping": null,
|
| 4 |
+
"base_model_name_or_path": "mistralai/Mistral-7B-v0.1",
|
| 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 |
+
"lora_alpha": 16,
|
| 12 |
+
"lora_dropout": 0.05,
|
| 13 |
+
"modules_to_save": null,
|
| 14 |
+
"peft_type": "LORA",
|
| 15 |
+
"r": 64,
|
| 16 |
+
"rank_pattern": {},
|
| 17 |
+
"revision": null,
|
| 18 |
+
"target_modules": [
|
| 19 |
+
"up_proj",
|
| 20 |
+
"v_proj",
|
| 21 |
+
"o_proj",
|
| 22 |
+
"q_proj",
|
| 23 |
+
"k_proj",
|
| 24 |
+
"down_proj",
|
| 25 |
+
"gate_proj"
|
| 26 |
+
],
|
| 27 |
+
"task_type": "CAUSAL_LM"
|
| 28 |
+
}
|
adapter_model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:092f6652d1b3515e1e7107214968f8a202434b048f1119327b9887093510ccb3
|
| 3 |
+
size 335604696
|
config.json
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"_name_or_path": "HuggingFaceH4/zephyr-7b-beta",
|
| 3 |
+
"architectures": [
|
| 4 |
+
"MistralForCausalLM"
|
| 5 |
+
],
|
| 6 |
+
"bos_token_id": 1,
|
| 7 |
+
"eos_token_id": 2,
|
| 8 |
+
"hidden_act": "silu",
|
| 9 |
+
"hidden_size": 4096,
|
| 10 |
+
"initializer_range": 0.02,
|
| 11 |
+
"intermediate_size": 14336,
|
| 12 |
+
"max_position_embeddings": 32768,
|
| 13 |
+
"model_type": "mistral",
|
| 14 |
+
"num_attention_heads": 32,
|
| 15 |
+
"num_hidden_layers": 32,
|
| 16 |
+
"num_key_value_heads": 8,
|
| 17 |
+
"pad_token_id": 2,
|
| 18 |
+
"rms_norm_eps": 1e-05,
|
| 19 |
+
"rope_theta": 10000.0,
|
| 20 |
+
"sliding_window": 4096,
|
| 21 |
+
"tie_word_embeddings": false,
|
| 22 |
+
"torch_dtype": "bfloat16",
|
| 23 |
+
"transformers_version": "4.35.0",
|
| 24 |
+
"use_cache": true,
|
| 25 |
+
"vocab_size": 32000
|
| 26 |
+
}
|