Add a model card
Browse files
README.md
CHANGED
@@ -1,3 +1,154 @@
|
|
1 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
license: apache-2.0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
---
|
2 |
+
tags:
|
3 |
+
- finetuned
|
4 |
+
- quantized
|
5 |
+
- 4-bit
|
6 |
+
- AWQ
|
7 |
+
- transformers
|
8 |
+
- pytorch
|
9 |
+
- mistral
|
10 |
+
- instruct
|
11 |
+
- text-generation
|
12 |
+
- conversational
|
13 |
+
- license:apache-2.0
|
14 |
+
- autotrain_compatible
|
15 |
+
- endpoints_compatible
|
16 |
+
- text-generation-inference
|
17 |
+
- finetune
|
18 |
+
- chatml
|
19 |
+
- generated_from_trainer
|
20 |
+
model-index:
|
21 |
+
- name: Senzu-7B-v0.1
|
22 |
+
results: []
|
23 |
license: apache-2.0
|
24 |
+
base_model: mistralai/Mistral-7B-v0.1
|
25 |
+
datasets:
|
26 |
+
- Intel/orca_dpo_pairs
|
27 |
+
- NeuralNovel/Neural-Story-v1
|
28 |
+
language:
|
29 |
+
- en
|
30 |
+
quantized_by: Suparious
|
31 |
+
pipeline_tag: text-generation
|
32 |
+
model_creator: NeuralNovel
|
33 |
+
model_name: Tiger 7B 0.1
|
34 |
+
inference: false
|
35 |
+
prompt_template: '<|im_start|>system
|
36 |
+
|
37 |
+
{system_message}<|im_end|>
|
38 |
+
|
39 |
+
<|im_start|>user
|
40 |
+
|
41 |
+
{prompt}<|im_end|>
|
42 |
+
|
43 |
+
<|im_start|>assistant
|
44 |
+
|
45 |
+
'
|
46 |
---
|
47 |
+
|
48 |
+
# Tiger 7B v0.1 AWQ
|
49 |
+
|
50 |
+
- Model creator: [NeuralNovel](https://huggingface.co/NeuralNovel)
|
51 |
+
- Original model: [Tiger-7B-v0.1](https://huggingface.co/NeuralNovel/Tiger-7B-v0.1)
|
52 |
+
|
53 |
+

|
54 |
+
|
55 |
+
## Model Details
|
56 |
+
|
57 |
+
This is a merge of pre-trained language models created using [mergekit](https://github.com/cg123/mergekit).
|
58 |
+
|
59 |
+
The following models were included in the merge:
|
60 |
+
* [NeuralNovel/Mistral-7B-Instruct-v0.2-Neural-Story](https://huggingface.co/NeuralNovel/Mistral-7B-Instruct-v0.2-Neural-Story)
|
61 |
+
* [NeuralNovel/Gecko-7B-v0.1-DPO](https://huggingface.co/NeuralNovel/Gecko-7B-v0.1-DPO)
|
62 |
+
|
63 |
+
The following YAML configuration was used to produce this model:
|
64 |
+
|
65 |
+
```yaml
|
66 |
+
|
67 |
+
slices:
|
68 |
+
- sources:
|
69 |
+
- model: NeuralNovel/Mistral-7B-Instruct-v0.2-Neural-Story
|
70 |
+
layer_range: [0, 32]
|
71 |
+
- model: NeuralNovel/Gecko-7B-v0.1-DPO
|
72 |
+
layer_range: [0, 32]
|
73 |
+
merge_method: slerp
|
74 |
+
base_model: NeuralNovel/Mistral-7B-Instruct-v0.2-Neural-Story
|
75 |
+
parameters:
|
76 |
+
t:
|
77 |
+
- filter: self_attn
|
78 |
+
value: [0, 0.5, 0.3, 0.7, 1]
|
79 |
+
- filter: mlp
|
80 |
+
value: [1, 0.5, 0.7, 0.3, 0]
|
81 |
+
- value: 0.5
|
82 |
+
dtype: bfloat16
|
83 |
+
|
84 |
+
## How to use
|
85 |
+
|
86 |
+
### Install the necessary packages
|
87 |
+
|
88 |
+
```bash
|
89 |
+
pip install --upgrade autoawq autoawq-kernels
|
90 |
+
```
|
91 |
+
|
92 |
+
### Example Python code
|
93 |
+
|
94 |
+
```python
|
95 |
+
from awq import AutoAWQForCausalLM
|
96 |
+
from transformers import AutoTokenizer, TextStreamer
|
97 |
+
|
98 |
+
model_path = "solidrust/Tiger-7B-v0.1-DPO-AWQ"
|
99 |
+
system_message = "You are Tiger, incarnated as a powerful AI."
|
100 |
+
|
101 |
+
# Load model
|
102 |
+
model = AutoAWQForCausalLM.from_quantized(model_path,
|
103 |
+
fuse_layers=True)
|
104 |
+
tokenizer = AutoTokenizer.from_pretrained(model_path,
|
105 |
+
trust_remote_code=True)
|
106 |
+
streamer = TextStreamer(tokenizer,
|
107 |
+
skip_prompt=True,
|
108 |
+
skip_special_tokens=True)
|
109 |
+
|
110 |
+
# Convert prompt to tokens
|
111 |
+
prompt_template = """\
|
112 |
+
<|im_start|>system
|
113 |
+
{system_message}<|im_end|>
|
114 |
+
<|im_start|>user
|
115 |
+
{prompt}<|im_end|>
|
116 |
+
<|im_start|>assistant"""
|
117 |
+
|
118 |
+
prompt = "You're standing on the surface of the Earth. "\
|
119 |
+
"You walk one mile south, one mile west and one mile north. "\
|
120 |
+
"You end up exactly where you started. Where are you?"
|
121 |
+
|
122 |
+
tokens = tokenizer(prompt_template.format(system_message=system_message,prompt=prompt),
|
123 |
+
return_tensors='pt').input_ids.cuda()
|
124 |
+
|
125 |
+
# Generate output
|
126 |
+
generation_output = model.generate(tokens,
|
127 |
+
streamer=streamer,
|
128 |
+
max_new_tokens=512)
|
129 |
+
|
130 |
+
```
|
131 |
+
|
132 |
+
### About AWQ
|
133 |
+
|
134 |
+
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.
|
135 |
+
|
136 |
+
AWQ models are currently supported on Linux and Windows, with NVidia GPUs only. macOS users: please use GGUF models instead.
|
137 |
+
|
138 |
+
It is supported by:
|
139 |
+
|
140 |
+
- [Text Generation Webui](https://github.com/oobabooga/text-generation-webui) - using Loader: AutoAWQ
|
141 |
+
- [vLLM](https://github.com/vllm-project/vllm) - version 0.2.2 or later for support for all model types.
|
142 |
+
- [Hugging Face Text Generation Inference (TGI)](https://github.com/huggingface/text-generation-inference)
|
143 |
+
- [Transformers](https://huggingface.co/docs/transformers) version 4.35.0 and later, from any code or client that supports Transformers
|
144 |
+
- [AutoAWQ](https://github.com/casper-hansen/AutoAWQ) - for use from Python code
|
145 |
+
|
146 |
+
## Prompt template: ChatML
|
147 |
+
|
148 |
+
```plaintext
|
149 |
+
<|im_start|>system
|
150 |
+
{system_message}<|im_end|>
|
151 |
+
<|im_start|>user
|
152 |
+
{prompt}<|im_end|>
|
153 |
+
<|im_start|>assistant
|
154 |
+
```
|