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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
---
|
2 |
+
license: cc-by-nc-4.0
|
3 |
+
model-index:
|
4 |
+
- name: Seraph-7B
|
5 |
+
results:
|
6 |
+
- task:
|
7 |
+
type: text-generation
|
8 |
+
name: Text Generation
|
9 |
+
dataset:
|
10 |
+
name: AI2 Reasoning Challenge (25-Shot)
|
11 |
+
type: ai2_arc
|
12 |
+
config: ARC-Challenge
|
13 |
+
split: test
|
14 |
+
args:
|
15 |
+
num_few_shot: 25
|
16 |
+
metrics:
|
17 |
+
- type: acc_norm
|
18 |
+
value: 67.83
|
19 |
+
name: normalized accuracy
|
20 |
+
source:
|
21 |
+
url: >-
|
22 |
+
https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard?query=Weyaxi/Seraph-7B
|
23 |
+
name: Open LLM Leaderboard
|
24 |
+
- task:
|
25 |
+
type: text-generation
|
26 |
+
name: Text Generation
|
27 |
+
dataset:
|
28 |
+
name: HellaSwag (10-Shot)
|
29 |
+
type: hellaswag
|
30 |
+
split: validation
|
31 |
+
args:
|
32 |
+
num_few_shot: 10
|
33 |
+
metrics:
|
34 |
+
- type: acc_norm
|
35 |
+
value: 86.22
|
36 |
+
name: normalized accuracy
|
37 |
+
source:
|
38 |
+
url: >-
|
39 |
+
https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard?query=Weyaxi/Seraph-7B
|
40 |
+
name: Open LLM Leaderboard
|
41 |
+
- task:
|
42 |
+
type: text-generation
|
43 |
+
name: Text Generation
|
44 |
+
dataset:
|
45 |
+
name: MMLU (5-Shot)
|
46 |
+
type: cais/mmlu
|
47 |
+
config: all
|
48 |
+
split: test
|
49 |
+
args:
|
50 |
+
num_few_shot: 5
|
51 |
+
metrics:
|
52 |
+
- type: acc
|
53 |
+
value: 65.07
|
54 |
+
name: accuracy
|
55 |
+
source:
|
56 |
+
url: >-
|
57 |
+
https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard?query=Weyaxi/Seraph-7B
|
58 |
+
name: Open LLM Leaderboard
|
59 |
+
- task:
|
60 |
+
type: text-generation
|
61 |
+
name: Text Generation
|
62 |
+
dataset:
|
63 |
+
name: TruthfulQA (0-shot)
|
64 |
+
type: truthful_qa
|
65 |
+
config: multiple_choice
|
66 |
+
split: validation
|
67 |
+
args:
|
68 |
+
num_few_shot: 0
|
69 |
+
metrics:
|
70 |
+
- type: mc2
|
71 |
+
value: 59.49
|
72 |
+
source:
|
73 |
+
url: >-
|
74 |
+
https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard?query=Weyaxi/Seraph-7B
|
75 |
+
name: Open LLM Leaderboard
|
76 |
+
- task:
|
77 |
+
type: text-generation
|
78 |
+
name: Text Generation
|
79 |
+
dataset:
|
80 |
+
name: Winogrande (5-shot)
|
81 |
+
type: winogrande
|
82 |
+
config: winogrande_xl
|
83 |
+
split: validation
|
84 |
+
args:
|
85 |
+
num_few_shot: 5
|
86 |
+
metrics:
|
87 |
+
- type: acc
|
88 |
+
value: 80.66
|
89 |
+
name: accuracy
|
90 |
+
source:
|
91 |
+
url: >-
|
92 |
+
https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard?query=Weyaxi/Seraph-7B
|
93 |
+
name: Open LLM Leaderboard
|
94 |
+
- task:
|
95 |
+
type: text-generation
|
96 |
+
name: Text Generation
|
97 |
+
dataset:
|
98 |
+
name: GSM8k (5-shot)
|
99 |
+
type: gsm8k
|
100 |
+
config: main
|
101 |
+
split: test
|
102 |
+
args:
|
103 |
+
num_few_shot: 5
|
104 |
+
metrics:
|
105 |
+
- type: acc
|
106 |
+
value: 71.87
|
107 |
+
name: accuracy
|
108 |
+
source:
|
109 |
+
url: >-
|
110 |
+
https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard?query=Weyaxi/Seraph-7B
|
111 |
+
name: Open LLM Leaderboard
|
112 |
+
tags:
|
113 |
+
- merge
|
114 |
+
- finetuned
|
115 |
+
- quantized
|
116 |
+
- 4-bit
|
117 |
+
- AWQ
|
118 |
+
- transformers
|
119 |
+
- pytorch
|
120 |
+
- mistral
|
121 |
+
- instruct
|
122 |
+
- text-generation
|
123 |
+
- conversational
|
124 |
+
- license:apache-2.0
|
125 |
+
- autotrain_compatible
|
126 |
+
- endpoints_compatible
|
127 |
+
- text-generation-inference
|
128 |
+
- finetune
|
129 |
+
- chatml
|
130 |
+
language:
|
131 |
+
- en
|
132 |
+
library_name: transformers
|
133 |
+
model_creator: Weyaxi
|
134 |
+
model_name: Seraph-7B
|
135 |
+
model_type: mistral
|
136 |
+
pipeline_tag: text-generation
|
137 |
+
inference: false
|
138 |
+
prompt_template: '<|im_start|>system
|
139 |
+
|
140 |
+
{system_message}<|im_end|>
|
141 |
+
|
142 |
+
<|im_start|>user
|
143 |
+
|
144 |
+
{prompt}<|im_end|>
|
145 |
+
|
146 |
+
<|im_start|>assistant
|
147 |
+
|
148 |
+
'
|
149 |
+
quantized_by: Suparious
|
150 |
---
|
151 |
+
# Weyaxi/Seraph-7B AWQ
|
152 |
+
|
153 |
+
- Model creator: [Weyaxi](https://huggingface.co/Weyaxi)
|
154 |
+
- Original model: [Seraph-7B](https://huggingface.co/Weyaxi/Seraph-7B)
|
155 |
+
|
156 |
+
![image/png](https://cdn-uploads.huggingface.co/production/uploads/6468ce47e134d050a58aa89c/ddzjZ1irvtLcDRCWei9vQ.png)
|
157 |
+
|
158 |
+
## Model Summary
|
159 |
+
|
160 |
+
This is the model for Seraph-7B. I used [mergekit](https://github.com/cg123/mergekit) to merge models.
|
161 |
+
|
162 |
+
```yaml
|
163 |
+
slices:
|
164 |
+
- sources:
|
165 |
+
- model: Weyaxi/OpenHermes-2.5-neural-chat-v3-3-Slerp
|
166 |
+
layer_range: [0, 32]
|
167 |
+
- model: Q-bert/MetaMath-Cybertron-Starling
|
168 |
+
layer_range: [0, 32]
|
169 |
+
merge_method: slerp
|
170 |
+
base_model: mistralai/Mistral-7B-v0.1
|
171 |
+
parameters:
|
172 |
+
t:
|
173 |
+
- filter: self_attn
|
174 |
+
value: [0, 0.5, 0.3, 0.7, 1]
|
175 |
+
- filter: mlp
|
176 |
+
value: [1, 0.5, 0.7, 0.3, 0]
|
177 |
+
- value: 0.5 # fallback for rest of tensors
|
178 |
+
dtype: bfloat16
|
179 |
+
```
|
180 |
+
|
181 |
+
## How to use
|
182 |
+
|
183 |
+
### Install the necessary packages
|
184 |
+
|
185 |
+
```bash
|
186 |
+
pip install --upgrade autoawq autoawq-kernels
|
187 |
+
```
|
188 |
+
|
189 |
+
### Example Python code
|
190 |
+
|
191 |
+
```python
|
192 |
+
from awq import AutoAWQForCausalLM
|
193 |
+
from transformers import AutoTokenizer, TextStreamer
|
194 |
+
|
195 |
+
model_path = "solidrust/Seraph-7B-AWQ/"
|
196 |
+
system_message = "You are Seraph, incarnated as a powerful AI."
|
197 |
+
|
198 |
+
# Load model
|
199 |
+
model = AutoAWQForCausalLM.from_quantized(model_path,
|
200 |
+
fuse_layers=True)
|
201 |
+
tokenizer = AutoTokenizer.from_pretrained(model_path,
|
202 |
+
trust_remote_code=True)
|
203 |
+
streamer = TextStreamer(tokenizer,
|
204 |
+
skip_prompt=True,
|
205 |
+
skip_special_tokens=True)
|
206 |
+
|
207 |
+
# Convert prompt to tokens
|
208 |
+
prompt_template = """\
|
209 |
+
<|im_start|>system
|
210 |
+
{system_message}<|im_end|>
|
211 |
+
<|im_start|>user
|
212 |
+
{prompt}<|im_end|>
|
213 |
+
<|im_start|>assistant"""
|
214 |
+
|
215 |
+
prompt = "You're standing on the surface of the Earth. "\
|
216 |
+
"You walk one mile south, one mile west and one mile north. "\
|
217 |
+
"You end up exactly where you started. Where are you?"
|
218 |
+
|
219 |
+
tokens = tokenizer(prompt_template.format(system_message=system_message,prompt=prompt),
|
220 |
+
return_tensors='pt').input_ids.cuda()
|
221 |
+
|
222 |
+
# Generate output
|
223 |
+
generation_output = model.generate(tokens,
|
224 |
+
streamer=streamer,
|
225 |
+
max_new_tokens=512)
|
226 |
+
|
227 |
+
```
|
228 |
+
|
229 |
+
### About AWQ
|
230 |
+
|
231 |
+
AWQ is an efficient, accurate and blazing-fast low-bit weight quantization method, currently supporting 4-bit quantization. Compared to GPTQ, it offers faster Transformers-based inference with equivalent or better quality compared to the most commonly used GPTQ settings.
|
232 |
+
|
233 |
+
AWQ models are currently supported on Linux and Windows, with NVidia GPUs only. macOS users: please use GGUF models instead.
|
234 |
+
|
235 |
+
It is supported by:
|
236 |
+
|
237 |
+
- [Text Generation Webui](https://github.com/oobabooga/text-generation-webui) - using Loader: AutoAWQ
|
238 |
+
- [vLLM](https://github.com/vllm-project/vllm) - version 0.2.2 or later for support for all model types.
|
239 |
+
- [Hugging Face Text Generation Inference (TGI)](https://github.com/huggingface/text-generation-inference)
|
240 |
+
- [Transformers](https://huggingface.co/docs/transformers) version 4.35.0 and later, from any code or client that supports Transformers
|
241 |
+
- [AutoAWQ](https://github.com/casper-hansen/AutoAWQ) - for use from Python code
|
242 |
+
|
243 |
+
## Prompt template: ChatML
|
244 |
+
|
245 |
+
```plaintext
|
246 |
+
<|im_start|>system
|
247 |
+
{system_message}<|im_end|>
|
248 |
+
<|im_start|>user
|
249 |
+
{prompt}<|im_end|>
|
250 |
+
<|im_start|>assistant
|
251 |
+
```
|