Update model card
Browse files
README.md
CHANGED
@@ -1,4 +1,24 @@
|
|
1 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
base_model: senseable/WestLake-7B-v2
|
3 |
license: apache-2.0
|
4 |
language:
|
@@ -34,6 +54,54 @@ This repo contains AWQ model files for [Common Sense's WestLake 7B v2](https://h
|
|
34 |
|
35 |
These files were quantised using hardware kindly provided by [SolidRusT Networks](https://solidrust.net/).
|
36 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
37 |
### About AWQ
|
38 |
|
39 |
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.
|
@@ -57,13 +125,3 @@ It is supported by:
|
|
57 |
{prompt}<|im_end|>
|
58 |
<|im_start|>assistant
|
59 |
```
|
60 |
-
|
61 |
-
Also working with Basic Mistral format:
|
62 |
-
|
63 |
-
```plaintext
|
64 |
-
<|system|>
|
65 |
-
</s>
|
66 |
-
<|user|>
|
67 |
-
{prompt}</s>
|
68 |
-
<|assistant|>
|
69 |
-
```
|
|
|
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 |
+
model-index:
|
20 |
+
- name: WestLake-7B-v2
|
21 |
+
results: []
|
22 |
base_model: senseable/WestLake-7B-v2
|
23 |
license: apache-2.0
|
24 |
language:
|
|
|
54 |
|
55 |
These files were quantised using hardware kindly provided by [SolidRusT Networks](https://solidrust.net/).
|
56 |
|
57 |
+
## How to use
|
58 |
+
|
59 |
+
### Install the necessary packages
|
60 |
+
|
61 |
+
```bash
|
62 |
+
pip install --upgrade autoawq autoawq-kernels
|
63 |
+
```
|
64 |
+
|
65 |
+
### Example Python code
|
66 |
+
|
67 |
+
```python
|
68 |
+
from awq import AutoAWQForCausalLM
|
69 |
+
from transformers import AutoTokenizer, TextStreamer
|
70 |
+
|
71 |
+
model_path = "solidrust/WestLake-7B-v2-AWQ"
|
72 |
+
system_message = "You are Senzu, incarnated as a powerful AI."
|
73 |
+
|
74 |
+
# Load model
|
75 |
+
model = AutoAWQForCausalLM.from_quantized(model_path,
|
76 |
+
fuse_layers=True)
|
77 |
+
tokenizer = AutoTokenizer.from_pretrained(model_path,
|
78 |
+
trust_remote_code=True)
|
79 |
+
streamer = TextStreamer(tokenizer,
|
80 |
+
skip_prompt=True,
|
81 |
+
skip_special_tokens=True)
|
82 |
+
|
83 |
+
# Convert prompt to tokens
|
84 |
+
prompt_template = """\
|
85 |
+
<|im_start|>system
|
86 |
+
{system_message}<|im_end|>
|
87 |
+
<|im_start|>user
|
88 |
+
{prompt}<|im_end|>
|
89 |
+
<|im_start|>assistant"""
|
90 |
+
|
91 |
+
prompt = "You're standing on the surface of the Earth. "\
|
92 |
+
"You walk one mile south, one mile west and one mile north. "\
|
93 |
+
"You end up exactly where you started. Where are you?"
|
94 |
+
|
95 |
+
tokens = tokenizer(prompt_template.format(system_message=system_message,prompt=prompt),
|
96 |
+
return_tensors='pt').input_ids.cuda()
|
97 |
+
|
98 |
+
# Generate output
|
99 |
+
generation_output = model.generate(tokens,
|
100 |
+
streamer=streamer,
|
101 |
+
max_new_tokens=512)
|
102 |
+
|
103 |
+
```
|
104 |
+
|
105 |
### About AWQ
|
106 |
|
107 |
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.
|
|
|
125 |
{prompt}<|im_end|>
|
126 |
<|im_start|>assistant
|
127 |
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|