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istry
|
6 |
+
- biology
|
7 |
+
- code
|
8 |
+
- medical
|
9 |
+
- quantized
|
10 |
+
- 4-bit
|
11 |
+
- AWQ
|
12 |
+
- text-generation
|
13 |
+
- autotrain_compatible
|
14 |
+
- endpoints_compatible
|
15 |
+
- chatml
|
16 |
+
datasets:
|
17 |
+
- Locutusque/Hercules-v3.0
|
18 |
+
model-index:
|
19 |
+
- name: Hercules-3.1-Mistral-7B
|
20 |
+
results:
|
21 |
+
- task:
|
22 |
+
type: text-generation
|
23 |
+
name: Text Generation
|
24 |
+
dataset:
|
25 |
+
name: AI2 Reasoning Challenge (25-Shot)
|
26 |
+
type: ai2_arc
|
27 |
+
config: ARC-Challenge
|
28 |
+
split: test
|
29 |
+
args:
|
30 |
+
num_few_shot: 25
|
31 |
+
metrics:
|
32 |
+
- type: acc_norm
|
33 |
+
value: 61.18
|
34 |
+
name: normalized accuracy
|
35 |
+
source:
|
36 |
+
url: https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard?query=Locutusque/Hercules-3.1-Mistral-7B
|
37 |
+
name: Open LLM Leaderboard
|
38 |
+
- task:
|
39 |
+
type: text-generation
|
40 |
+
name: Text Generation
|
41 |
+
dataset:
|
42 |
+
name: HellaSwag (10-Shot)
|
43 |
+
type: hellaswag
|
44 |
+
split: validation
|
45 |
+
args:
|
46 |
+
num_few_shot: 10
|
47 |
+
metrics:
|
48 |
+
- type: acc_norm
|
49 |
+
value: 83.55
|
50 |
+
name: normalized accuracy
|
51 |
+
source:
|
52 |
+
url: https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard?query=Locutusque/Hercules-3.1-Mistral-7B
|
53 |
+
name: Open LLM Leaderboard
|
54 |
+
- task:
|
55 |
+
type: text-generation
|
56 |
+
name: Text Generation
|
57 |
+
dataset:
|
58 |
+
name: MMLU (5-Shot)
|
59 |
+
type: cais/mmlu
|
60 |
+
config: all
|
61 |
+
split: test
|
62 |
+
args:
|
63 |
+
num_few_shot: 5
|
64 |
+
metrics:
|
65 |
+
- type: acc
|
66 |
+
value: 63.65
|
67 |
+
name: accuracy
|
68 |
+
source:
|
69 |
+
url: https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard?query=Locutusque/Hercules-3.1-Mistral-7B
|
70 |
+
name: Open LLM Leaderboard
|
71 |
+
- task:
|
72 |
+
type: text-generation
|
73 |
+
name: Text Generation
|
74 |
+
dataset:
|
75 |
+
name: TruthfulQA (0-shot)
|
76 |
+
type: truthful_qa
|
77 |
+
config: multiple_choice
|
78 |
+
split: validation
|
79 |
+
args:
|
80 |
+
num_few_shot: 0
|
81 |
+
metrics:
|
82 |
+
- type: mc2
|
83 |
+
value: 42.83
|
84 |
+
source:
|
85 |
+
url: https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard?query=Locutusque/Hercules-3.1-Mistral-7B
|
86 |
+
name: Open LLM Leaderboard
|
87 |
+
- task:
|
88 |
+
type: text-generation
|
89 |
+
name: Text Generation
|
90 |
+
dataset:
|
91 |
+
name: Winogrande (5-shot)
|
92 |
+
type: winogrande
|
93 |
+
config: winogrande_xl
|
94 |
+
split: validation
|
95 |
+
args:
|
96 |
+
num_few_shot: 5
|
97 |
+
metrics:
|
98 |
+
- type: acc
|
99 |
+
value: 79.01
|
100 |
+
name: accuracy
|
101 |
+
source:
|
102 |
+
url: https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard?query=Locutusque/Hercules-3.1-Mistral-7B
|
103 |
+
name: Open LLM Leaderboard
|
104 |
+
- task:
|
105 |
+
type: text-generation
|
106 |
+
name: Text Generation
|
107 |
+
dataset:
|
108 |
+
name: GSM8k (5-shot)
|
109 |
+
type: gsm8k
|
110 |
+
config: main
|
111 |
+
split: test
|
112 |
+
args:
|
113 |
+
num_few_shot: 5
|
114 |
+
metrics:
|
115 |
+
- type: acc
|
116 |
+
value: 42.3
|
117 |
+
name: accuracy
|
118 |
+
source:
|
119 |
+
url: https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard?query=Locutusque/Hercules-3.1-Mistral-7B
|
120 |
+
name: Open LLM Leaderboard
|
121 |
+
language:
|
122 |
+
- en
|
123 |
+
model_creator: Locutusque
|
124 |
+
model_name: Hercules-3.1-Mistral-7B
|
125 |
+
model_type: mistral
|
126 |
+
pipeline_tag: text-generation
|
127 |
+
inference: false
|
128 |
+
prompt_template: '<|im_start|>system
|
129 |
+
|
130 |
+
{system_message}<|im_end|>
|
131 |
+
|
132 |
+
<|im_start|>user
|
133 |
+
|
134 |
+
{prompt}<|im_end|>
|
135 |
+
|
136 |
+
<|im_start|>assistant
|
137 |
+
|
138 |
+
'
|
139 |
+
quantized_by: Suparious
|
140 |
---
|
141 |
+
# Model Card: Hercules-3.1-Mistral-7B
|
142 |
+
|
143 |
+
- Model creator: [Locutusque](https://huggingface.co/Locutusque)
|
144 |
+
- Original model: [Hercules-3.1-Mistral-7B](https://huggingface.co/Locutusque/Hercules-3.1-Mistral-7B)
|
145 |
+
|
146 |
+
![image/png](https://cdn-uploads.huggingface.co/production/uploads/6437292ecd93f4c9a34b0d47/Ip9wEG2Ne4vihNStHSDvX.png)
|
147 |
+
|
148 |
+
## Model Description
|
149 |
+
|
150 |
+
Hercules-3.1-Mistral-7B is a fine-tuned language model derived from Mistralai/Mistral-7B-v0.1. It is specifically designed to excel in instruction following, function calls, and conversational interactions across various scientific and technical domains. The dataset used for fine-tuning, also named Hercules-v3.0, expands upon the diverse capabilities of OpenHermes-2.5 with contributions from numerous curated datasets. This fine-tuning has hercules-v3.0 with enhanced abilities in:
|
151 |
+
|
152 |
+
- Complex Instruction Following: Understanding and accurately executing multi-step instructions, even those involving specialized terminology.
|
153 |
+
- Function Calling: Seamlessly interpreting and executing function calls, providing appropriate input and output values.
|
154 |
+
- Domain-Specific Knowledge: Engaging in informative and educational conversations about Biology, Chemistry, Physics, Mathematics, Medicine, Computer Science, and more.
|
155 |
+
|
156 |
+
## How to use
|
157 |
+
|
158 |
+
### Install the necessary packages
|
159 |
+
|
160 |
+
```bash
|
161 |
+
pip install --upgrade autoawq autoawq-kernels
|
162 |
+
```
|
163 |
+
|
164 |
+
### Example Python code
|
165 |
+
|
166 |
+
```python
|
167 |
+
from awq import AutoAWQForCausalLM
|
168 |
+
from transformers import AutoTokenizer, TextStreamer
|
169 |
+
|
170 |
+
model_path = "solidrust/Hercules-3.1-Mistral-7B-AWQ"
|
171 |
+
system_message = "You are Senzu, incarnated as a powerful AI."
|
172 |
+
|
173 |
+
# Load model
|
174 |
+
model = AutoAWQForCausalLM.from_quantized(model_path,
|
175 |
+
fuse_layers=True)
|
176 |
+
tokenizer = AutoTokenizer.from_pretrained(model_path,
|
177 |
+
trust_remote_code=True)
|
178 |
+
streamer = TextStreamer(tokenizer,
|
179 |
+
skip_prompt=True,
|
180 |
+
skip_special_tokens=True)
|
181 |
+
|
182 |
+
# Convert prompt to tokens
|
183 |
+
prompt_template = """\
|
184 |
+
<|im_start|>system
|
185 |
+
{system_message}<|im_end|>
|
186 |
+
<|im_start|>user
|
187 |
+
{prompt}<|im_end|>
|
188 |
+
<|im_start|>assistant"""
|
189 |
+
|
190 |
+
prompt = "You're standing on the surface of the Earth. "\
|
191 |
+
"You walk one mile south, one mile west and one mile north. "\
|
192 |
+
"You end up exactly where you started. Where are you?"
|
193 |
+
|
194 |
+
tokens = tokenizer(prompt_template.format(system_message=system_message,prompt=prompt),
|
195 |
+
return_tensors='pt').input_ids.cuda()
|
196 |
+
|
197 |
+
# Generate output
|
198 |
+
generation_output = model.generate(tokens,
|
199 |
+
streamer=streamer,
|
200 |
+
max_new_tokens=512)
|
201 |
+
|
202 |
+
```
|
203 |
+
|
204 |
+
### About AWQ
|
205 |
+
|
206 |
+
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.
|
207 |
+
|
208 |
+
AWQ models are currently supported on Linux and Windows, with NVidia GPUs only. macOS users: please use GGUF models instead.
|
209 |
+
|
210 |
+
It is supported by:
|
211 |
+
|
212 |
+
- [Text Generation Webui](https://github.com/oobabooga/text-generation-webui) - using Loader: AutoAWQ
|
213 |
+
- [vLLM](https://github.com/vllm-project/vllm) - version 0.2.2 or later for support for all model types.
|
214 |
+
- [Hugging Face Text Generation Inference (TGI)](https://github.com/huggingface/text-generation-inference)
|
215 |
+
- [Transformers](https://huggingface.co/docs/transformers) version 4.35.0 and later, from any code or client that supports Transformers
|
216 |
+
- [AutoAWQ](https://github.com/casper-hansen/AutoAWQ) - for use from Python code
|
217 |
+
|
218 |
+
## Prompt template: ChatML
|
219 |
+
|
220 |
+
```plaintext
|
221 |
+
<|im_start|>system
|
222 |
+
{system_message}<|im_end|>
|
223 |
+
<|im_start|>user
|
224 |
+
{prompt}<|im_end|>
|
225 |
+
<|im_start|>assistant
|
226 |
+
```
|