initial model card
Browse files
README.md
CHANGED
@@ -1,3 +1,88 @@
|
|
1 |
---
|
|
|
2 |
license: cc-by-sa-4.0
|
|
|
|
|
|
|
|
|
|
|
3 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
---
|
2 |
+
library_name: transformers
|
3 |
license: cc-by-sa-4.0
|
4 |
+
datasets:
|
5 |
+
- mlabonne/chatml_dpo_pairs
|
6 |
+
- ResplendentAI/Synthetic_Soul_1k
|
7 |
+
language:
|
8 |
+
- en
|
9 |
---
|
10 |
+
# ResplendentAI/Flora-7B-DPO AWQ
|
11 |
+
|
12 |
+

|
13 |
+
|
14 |
+
## Model Summary
|
15 |
+
|
16 |
+
Finetuned with this DPO dataset: https://huggingface.co/datasets/mlabonne/chatml_dpo_pairs
|
17 |
+
|
18 |
+
## How to use
|
19 |
+
|
20 |
+
### Install the necessary packages
|
21 |
+
|
22 |
+
```bash
|
23 |
+
pip install --upgrade autoawq autoawq-kernels
|
24 |
+
```
|
25 |
+
|
26 |
+
### Example Python code
|
27 |
+
|
28 |
+
```python
|
29 |
+
from awq import AutoAWQForCausalLM
|
30 |
+
from transformers import AutoTokenizer, TextStreamer
|
31 |
+
|
32 |
+
model_path = "solidrust/Flora-7B-DPO-AWQ"
|
33 |
+
system_message = "You are Dolphin, a helpful AI assistant."
|
34 |
+
|
35 |
+
# Load model
|
36 |
+
model = AutoAWQForCausalLM.from_quantized(model_path,
|
37 |
+
fuse_layers=True)
|
38 |
+
tokenizer = AutoTokenizer.from_pretrained(model_path,
|
39 |
+
trust_remote_code=True)
|
40 |
+
streamer = TextStreamer(tokenizer,
|
41 |
+
skip_prompt=True,
|
42 |
+
skip_special_tokens=True)
|
43 |
+
|
44 |
+
# Convert prompt to tokens
|
45 |
+
prompt_template = """\
|
46 |
+
<|im_start|>system
|
47 |
+
{system_message}<|im_end|>
|
48 |
+
<|im_start|>user
|
49 |
+
{prompt}<|im_end|>
|
50 |
+
<|im_start|>assistant"""
|
51 |
+
|
52 |
+
prompt = "You're standing on the surface of the Earth. "\
|
53 |
+
"You walk one mile south, one mile west and one mile north. "\
|
54 |
+
"You end up exactly where you started. Where are you?"
|
55 |
+
|
56 |
+
tokens = tokenizer(prompt_template.format(system_message=system_message,prompt=prompt),
|
57 |
+
return_tensors='pt').input_ids.cuda()
|
58 |
+
|
59 |
+
# Generate output
|
60 |
+
generation_output = model.generate(tokens,
|
61 |
+
streamer=streamer,
|
62 |
+
max_new_tokens=512)
|
63 |
+
|
64 |
+
```
|
65 |
+
|
66 |
+
### About AWQ
|
67 |
+
|
68 |
+
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.
|
69 |
+
|
70 |
+
AWQ models are currently supported on Linux and Windows, with NVidia GPUs only. macOS users: please use GGUF models instead.
|
71 |
+
|
72 |
+
It is supported by:
|
73 |
+
|
74 |
+
- [Text Generation Webui](https://github.com/oobabooga/text-generation-webui) - using Loader: AutoAWQ
|
75 |
+
- [vLLM](https://github.com/vllm-project/vllm) - version 0.2.2 or later for support for all model types.
|
76 |
+
- [Hugging Face Text Generation Inference (TGI)](https://github.com/huggingface/text-generation-inference)
|
77 |
+
- [Transformers](https://huggingface.co/docs/transformers) version 4.35.0 and later, from any code or client that supports Transformers
|
78 |
+
- [AutoAWQ](https://github.com/casper-hansen/AutoAWQ) - for use from Python code
|
79 |
+
|
80 |
+
## Prompt template: ChatML
|
81 |
+
|
82 |
+
```plaintext
|
83 |
+
<|im_start|>system
|
84 |
+
{system_message}<|im_end|>
|
85 |
+
<|im_start|>user
|
86 |
+
{prompt}<|im_end|>
|
87 |
+
<|im_start|>assistant
|
88 |
+
```
|