Crystalcareai commited on
Commit
c8c7628
·
1 Parent(s): 9fbd0be

Upload model

Browse files
Files changed (3) hide show
  1. README.md +3 -141
  2. adapter_config.json +23 -0
  3. adapter_model.bin +3 -0
README.md CHANGED
@@ -1,147 +1,9 @@
1
  ---
2
- tags:
3
- - generated_from_trainer
4
- model-index:
5
- - name: zephyr-7b-alpha
6
- results: []
7
- license: mit
8
- datasets:
9
- - stingning/ultrachat
10
- - openbmb/UltraFeedback
11
- language:
12
- - en
13
- base_model: mistralai/Mistral-7B-v0.1
14
  ---
15
-
16
- <!-- This model card has been generated automatically according to the information the Trainer had access to. You
17
- should probably proofread and complete it, then remove this comment. -->
18
-
19
- <img src="https://huggingface.co/HuggingFaceH4/zephyr-7b-alpha/resolve/main/thumbnail.png" alt="Zephyr Logo" width="800" style="margin-left:'auto' margin-right:'auto' display:'block'"/>
20
-
21
-
22
- # Model Card for Zephyr 7B Alpha
23
-
24
- Zephyr is a series of language models that are trained to act as helpful assistants. Zephyr-7B-α is the first model in the series, and is a fine-tuned version of [mistralai/Mistral-7B-v0.1](https://huggingface.co/mistralai/Mistral-7B-v0.1) that was trained on on a mix of publicly available, synthetic datasets using [Direct Preference Optimization (DPO)](https://arxiv.org/abs/2305.18290). We found that removing the in-built alignment of these datasets boosted performance on [MT Bench](https://huggingface.co/spaces/lmsys/mt-bench) and made the model more helpful. However, this means that model is likely to generate problematic text when prompted to do so.
25
-
26
-
27
- ## Model description
28
-
29
- - **Model type:** A 7B parameter GPT-like model fine-tuned on a mix of publicly available, synthetic datasets.
30
- - **Language(s) (NLP):** Primarily English
31
- - **License:** MIT
32
- - **Finetuned from model:** [mistralai/Mistral-7B-v0.1](https://huggingface.co/mistralai/Mistral-7B-v0.1)
33
-
34
- ### Model Sources
35
-
36
- <!-- Provide the basic links for the model. -->
37
-
38
- - **Repository:** https://github.com/huggingface/alignment-handbook
39
- - **Demo:** https://huggingface.co/spaces/HuggingFaceH4/zephyr-chat
40
-
41
- ## Intended uses & limitations
42
-
43
- The model was initially fine-tuned on a variant of the [`UltraChat`](https://huggingface.co/datasets/stingning/ultrachat) dataset, which contains a diverse range of synthetic dialogues generated by ChatGPT. We then further aligned the model with [🤗 TRL's](https://github.com/huggingface/trl) `DPOTrainer` on the [openbmb/UltraFeedback](https://huggingface.co/datasets/openbmb/UltraFeedback) dataset, which contain 64k prompts and model completions that are ranked by GPT-4. As a result, the model can be used for chat and you can check out our [demo](https://huggingface.co/spaces/HuggingFaceH4/zephyr-chat) to test its capabilities.
44
-
45
- Here's how you can run the model using the `pipeline()` function from 🤗 Transformers:
46
-
47
- ```python
48
- # Install transformers from source - only needed for versions <= v4.34
49
- # pip install git+https://github.com/huggingface/transformers.git
50
- # pip install accelerate
51
-
52
- import torch
53
- from transformers import pipeline
54
-
55
- pipe = pipeline("text-generation", model="HuggingFaceH4/zephyr-7b-alpha", torch_dtype=torch.bfloat16, device_map="auto")
56
-
57
- # We use the tokenizer's chat template to format each message - see https://huggingface.co/docs/transformers/main/en/chat_templating
58
- messages = [
59
- {
60
- "role": "system",
61
- "content": "You are a friendly chatbot who always responds in the style of a pirate",
62
- },
63
- {"role": "user", "content": "How many helicopters can a human eat in one sitting?"},
64
- ]
65
- prompt = pipe.tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
66
- outputs = pipe(prompt, max_new_tokens=256, do_sample=True, temperature=0.7, top_k=50, top_p=0.95)
67
- print(outputs[0]["generated_text"])
68
- # <|system|>
69
- # You are a friendly chatbot who always responds in the style of a pirate.</s>
70
- # <|user|>
71
- # How many helicopters can a human eat in one sitting?</s>
72
- # <|assistant|>
73
- # Ah, me hearty matey! But yer question be a puzzler! A human cannot eat a helicopter in one sitting, as helicopters are not edible. They be made of metal, plastic, and other materials, not food!
74
- ```
75
-
76
- ## Bias, Risks, and Limitations
77
-
78
- <!-- This section is meant to convey both technical and sociotechnical limitations. -->
79
-
80
- Zephyr-7B-α has not been aligned to human preferences with techniques like RLHF or deployed with in-the-loop filtering of responses like ChatGPT, so the model can produce problematic outputs (especially when prompted to do so).
81
- It is also unknown what the size and composition of the corpus was used to train the base model (`mistralai/Mistral-7B-v0.1`), however it is likely to have included a mix of Web data and technical sources like books and code. See the [Falcon 180B model card](https://huggingface.co/tiiuae/falcon-180B#training-data) for an example of this.
82
-
83
-
84
- ## Training and evaluation data
85
-
86
- Zephyr 7B Alpha achieves the following results on the evaluation set:
87
-
88
- - Loss: 0.4605
89
- - Rewards/chosen: -0.5053
90
- - Rewards/rejected: -1.8752
91
- - Rewards/accuracies: 0.7812
92
- - Rewards/margins: 1.3699
93
- - Logps/rejected: -327.4286
94
- - Logps/chosen: -297.1040
95
- - Logits/rejected: -2.7153
96
- - Logits/chosen: -2.7447
97
-
98
  ## Training procedure
99
 
100
- ### Training hyperparameters
101
-
102
- The following hyperparameters were used during training:
103
-
104
- - learning_rate: 5e-07
105
- - train_batch_size: 2
106
- - eval_batch_size: 4
107
- - seed: 42
108
- - distributed_type: multi-GPU
109
- - num_devices: 16
110
- - total_train_batch_size: 32
111
- - total_eval_batch_size: 64
112
- - optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
113
- - lr_scheduler_type: linear
114
- - lr_scheduler_warmup_ratio: 0.1
115
- - num_epochs: 1
116
-
117
- ### Training results
118
-
119
- | Training Loss | Epoch | Step | Validation Loss | Rewards/chosen | Rewards/rejected | Rewards/accuracies | Rewards/margins | Logps/rejected | Logps/chosen | Logits/rejected | Logits/chosen |
120
- |:-------------:|:-----:|:----:|:---------------:|:--------------:|:----------------:|:------------------:|:---------------:|:--------------:|:------------:|:---------------:|:-------------:|
121
- | 0.5602 | 0.05 | 100 | 0.5589 | -0.3359 | -0.8168 | 0.7188 | 0.4809 | -306.2607 | -293.7161 | -2.6554 | -2.6797 |
122
- | 0.4852 | 0.1 | 200 | 0.5136 | -0.5310 | -1.4994 | 0.8125 | 0.9684 | -319.9124 | -297.6181 | -2.5762 | -2.5957 |
123
- | 0.5212 | 0.15 | 300 | 0.5168 | -0.1686 | -1.1760 | 0.7812 | 1.0074 | -313.4444 | -290.3699 | -2.6865 | -2.7125 |
124
- | 0.5496 | 0.21 | 400 | 0.4835 | -0.1617 | -1.7170 | 0.8281 | 1.5552 | -324.2635 | -290.2326 | -2.7947 | -2.8218 |
125
- | 0.5209 | 0.26 | 500 | 0.5054 | -0.4778 | -1.6604 | 0.7344 | 1.1826 | -323.1325 | -296.5546 | -2.8388 | -2.8667 |
126
- | 0.4617 | 0.31 | 600 | 0.4910 | -0.3738 | -1.5180 | 0.7656 | 1.1442 | -320.2848 | -294.4741 | -2.8234 | -2.8521 |
127
- | 0.4452 | 0.36 | 700 | 0.4838 | -0.4591 | -1.6576 | 0.7031 | 1.1986 | -323.0770 | -296.1796 | -2.7401 | -2.7653 |
128
- | 0.4674 | 0.41 | 800 | 0.5077 | -0.5692 | -1.8659 | 0.7656 | 1.2967 | -327.2416 | -298.3818 | -2.6740 | -2.6945 |
129
- | 0.4656 | 0.46 | 900 | 0.4927 | -0.5279 | -1.6614 | 0.7656 | 1.1335 | -323.1518 | -297.5553 | -2.7817 | -2.8015 |
130
- | 0.4102 | 0.52 | 1000 | 0.4772 | -0.5767 | -2.0667 | 0.7656 | 1.4900 | -331.2578 | -298.5311 | -2.7160 | -2.7455 |
131
- | 0.4663 | 0.57 | 1100 | 0.4740 | -0.8038 | -2.1018 | 0.7656 | 1.2980 | -331.9604 | -303.0741 | -2.6994 | -2.7257 |
132
- | 0.4737 | 0.62 | 1200 | 0.4716 | -0.3783 | -1.7015 | 0.7969 | 1.3232 | -323.9545 | -294.5634 | -2.6842 | -2.7135 |
133
- | 0.4259 | 0.67 | 1300 | 0.4866 | -0.6239 | -1.9703 | 0.7812 | 1.3464 | -329.3312 | -299.4761 | -2.7046 | -2.7356 |
134
- | 0.4935 | 0.72 | 1400 | 0.4747 | -0.5626 | -1.7600 | 0.7812 | 1.1974 | -325.1243 | -298.2491 | -2.7153 | -2.7444 |
135
- | 0.4211 | 0.77 | 1500 | 0.4645 | -0.6099 | -1.9993 | 0.7656 | 1.3894 | -329.9109 | -299.1959 | -2.6944 | -2.7236 |
136
- | 0.4931 | 0.83 | 1600 | 0.4684 | -0.6798 | -2.1082 | 0.7656 | 1.4285 | -332.0890 | -300.5934 | -2.7006 | -2.7305 |
137
- | 0.5029 | 0.88 | 1700 | 0.4595 | -0.5063 | -1.8951 | 0.7812 | 1.3889 | -327.8267 | -297.1233 | -2.7108 | -2.7403 |
138
- | 0.4965 | 0.93 | 1800 | 0.4613 | -0.5561 | -1.9079 | 0.7812 | 1.3518 | -328.0831 | -298.1203 | -2.7226 | -2.7523 |
139
- | 0.4337 | 0.98 | 1900 | 0.4608 | -0.5066 | -1.8718 | 0.7656 | 1.3652 | -327.3599 | -297.1296 | -2.7175 | -2.7469 |
140
-
141
-
142
  ### Framework versions
143
 
144
- - Transformers 4.34.0
145
- - Pytorch 2.0.1+cu118
146
- - Datasets 2.12.0
147
- - Tokenizers 0.14.0
 
1
  ---
2
+ library_name: peft
 
 
 
 
 
 
 
 
 
 
 
3
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4
  ## Training procedure
5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6
  ### Framework versions
7
 
8
+
9
+ - PEFT 0.5.0
 
 
adapter_config.json ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "auto_mapping": null,
3
+ "base_model_name_or_path": "HuggingFaceH4/zephyr-7b-alpha",
4
+ "bias": "none",
5
+ "fan_in_fan_out": false,
6
+ "inference_mode": true,
7
+ "init_lora_weights": true,
8
+ "layers_pattern": null,
9
+ "layers_to_transform": null,
10
+ "lora_alpha": 16,
11
+ "lora_dropout": 0,
12
+ "modules_to_save": null,
13
+ "peft_type": "LORA",
14
+ "r": 8,
15
+ "revision": null,
16
+ "target_modules": [
17
+ "q_proj",
18
+ "k_proj",
19
+ "v_proj",
20
+ "o_proj"
21
+ ],
22
+ "task_type": "CAUSAL_LM"
23
+ }
adapter_model.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2341fd3df91710aa124e49cb2c59304fbb3b2274034f7a0cad1ebd1ff7e895dd
3
+ size 27355402