Update Model Card tags and avatar
Browse files
README.md
CHANGED
@@ -1,3 +1,128 @@
|
|
1 |
---
|
2 |
license: apache-2.0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
---
|
2 |
license: apache-2.0
|
3 |
+
tags:
|
4 |
+
- finetuned
|
5 |
+
- text-generation
|
6 |
+
- autotrain_compatible
|
7 |
+
- endpoints_compatible
|
8 |
+
- chatml
|
9 |
+
- quantized
|
10 |
+
- 4-bit
|
11 |
+
- AWQ
|
12 |
+
library_name: transformers
|
13 |
+
language:
|
14 |
+
- en
|
15 |
+
model_creator: l3utterfly
|
16 |
+
model_name: mistral-7b-v0.2-layla-v4
|
17 |
+
model_type: mistral
|
18 |
+
pipeline_tag: text-generation
|
19 |
+
inference: false
|
20 |
+
prompt_template: '<|im_start|>system
|
21 |
+
|
22 |
+
{system_message}<|im_end|>
|
23 |
+
|
24 |
+
<|im_start|>user
|
25 |
+
|
26 |
+
{prompt}<|im_end|>
|
27 |
+
|
28 |
+
<|im_start|>assistant
|
29 |
+
|
30 |
+
'
|
31 |
+
quantized_by: Suparious
|
32 |
---
|
33 |
+
# l3utterfly/mistral-7b-v0.2-layla-v4 AWQ
|
34 |
+
|
35 |
+
- Model creator: [l3utterfly](https://huggingface.co/l3utterfly)
|
36 |
+
- Original model: [mistral-7b-v0.2-layla-v4](https://huggingface.co/l3utterfly/mistral-7b-v0.2-layla-v4)
|
37 |
+
|
38 |
+
![image/png](https://cdn-uploads.huggingface.co/production/uploads/64a500f3143b1c7b5807cec7/O0CsatpKzzfQApIOropH_.png)
|
39 |
+
(image by https://huggingface.co/Kronikus)
|
40 |
+
|
41 |
+
## Model Summary
|
42 |
+
|
43 |
+
Mistral 7B (v0.2) fine-tuned by the OpenHermes 2.5 dataset optimised for multi-turn conversation and character impersonation.
|
44 |
+
|
45 |
+
The dataset has been pre-processed by doing the following:
|
46 |
+
1. remove all refusals
|
47 |
+
2. remove any mention of AI assistant
|
48 |
+
3. split any multi-turn dialog generated in the dataset into multi-turn conversations records
|
49 |
+
4. added nfsw generated conversations from the Teatime dataset
|
50 |
+
|
51 |
+
- **Developed by:** l3utterfly
|
52 |
+
- **Funded by:** Layla Network
|
53 |
+
- **Model type:** Mistral
|
54 |
+
- **Language(s) (NLP):** English
|
55 |
+
- **License:** Apache-2.0
|
56 |
+
- **Finetuned from model:** Mistral 7B (v0.2)
|
57 |
+
|
58 |
+
## How to use
|
59 |
+
|
60 |
+
### Install the necessary packages
|
61 |
+
|
62 |
+
```bash
|
63 |
+
pip install --upgrade autoawq autoawq-kernels
|
64 |
+
```
|
65 |
+
|
66 |
+
### Example Python code
|
67 |
+
|
68 |
+
```python
|
69 |
+
from awq import AutoAWQForCausalLM
|
70 |
+
from transformers import AutoTokenizer, TextStreamer
|
71 |
+
|
72 |
+
model_path = "solidrust/mistral-7b-v0.2-layla-v4-AWQ"
|
73 |
+
system_message = "You are Layla, incarnated as a powerful AI."
|
74 |
+
|
75 |
+
# Load model
|
76 |
+
model = AutoAWQForCausalLM.from_quantized(model_path,
|
77 |
+
fuse_layers=True)
|
78 |
+
tokenizer = AutoTokenizer.from_pretrained(model_path,
|
79 |
+
trust_remote_code=True)
|
80 |
+
streamer = TextStreamer(tokenizer,
|
81 |
+
skip_prompt=True,
|
82 |
+
skip_special_tokens=True)
|
83 |
+
|
84 |
+
# Convert prompt to tokens
|
85 |
+
prompt_template = """\
|
86 |
+
<|im_start|>system
|
87 |
+
{system_message}<|im_end|>
|
88 |
+
<|im_start|>user
|
89 |
+
{prompt}<|im_end|>
|
90 |
+
<|im_start|>assistant"""
|
91 |
+
|
92 |
+
prompt = "You're standing on the surface of the Earth. "\
|
93 |
+
"You walk one mile south, one mile west and one mile north. "\
|
94 |
+
"You end up exactly where you started. Where are you?"
|
95 |
+
|
96 |
+
tokens = tokenizer(prompt_template.format(system_message=system_message,prompt=prompt),
|
97 |
+
return_tensors='pt').input_ids.cuda()
|
98 |
+
|
99 |
+
# Generate output
|
100 |
+
generation_output = model.generate(tokens,
|
101 |
+
streamer=streamer,
|
102 |
+
max_new_tokens=512)
|
103 |
+
|
104 |
+
```
|
105 |
+
|
106 |
+
### About AWQ
|
107 |
+
|
108 |
+
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.
|
109 |
+
|
110 |
+
AWQ models are currently supported on Linux and Windows, with NVidia GPUs only. macOS users: please use GGUF models instead.
|
111 |
+
|
112 |
+
It is supported by:
|
113 |
+
|
114 |
+
- [Text Generation Webui](https://github.com/oobabooga/text-generation-webui) - using Loader: AutoAWQ
|
115 |
+
- [vLLM](https://github.com/vllm-project/vllm) - version 0.2.2 or later for support for all model types.
|
116 |
+
- [Hugging Face Text Generation Inference (TGI)](https://github.com/huggingface/text-generation-inference)
|
117 |
+
- [Transformers](https://huggingface.co/docs/transformers) version 4.35.0 and later, from any code or client that supports Transformers
|
118 |
+
- [AutoAWQ](https://github.com/casper-hansen/AutoAWQ) - for use from Python code
|
119 |
+
|
120 |
+
## Prompt template: ChatML
|
121 |
+
|
122 |
+
```plaintext
|
123 |
+
<|im_start|>system
|
124 |
+
{system_message}<|im_end|>
|
125 |
+
<|im_start|>user
|
126 |
+
{prompt}<|im_end|>
|
127 |
+
<|im_start|>assistant
|
128 |
+
```
|