Update README.md
Browse files
README.md
CHANGED
|
@@ -1,120 +1,99 @@
|
|
| 1 |
-
---
|
| 2 |
-
library_name: transformers
|
| 3 |
-
tags:
|
| 4 |
-
- 4-bit
|
| 5 |
-
- AWQ
|
| 6 |
-
- text-generation
|
| 7 |
-
- autotrain_compatible
|
| 8 |
-
- endpoints_compatible
|
| 9 |
-
- Llama-3
|
| 10 |
-
- instruct
|
| 11 |
-
- finetune
|
| 12 |
-
- chatml
|
| 13 |
-
- DPO
|
| 14 |
-
- RLHF
|
| 15 |
-
- gpt4
|
| 16 |
-
- synthetic data
|
| 17 |
-
- distillation
|
| 18 |
-
- function calling
|
| 19 |
-
- json mode
|
| 20 |
-
- axolotl
|
| 21 |
-
model-index:
|
| 22 |
-
- name: Hermes-2-Pro-Llama-3-8B
|
| 23 |
-
results: []
|
| 24 |
-
license: apache-2.0
|
| 25 |
-
language:
|
| 26 |
-
- en
|
| 27 |
-
datasets:
|
| 28 |
-
- teknium/OpenHermes-2.5
|
| 29 |
-
widget:
|
| 30 |
-
- example_title: Hermes 2 Pro
|
| 31 |
-
messages:
|
| 32 |
-
- role: system
|
| 33 |
-
content: You are a sentient, superintelligent artificial general intelligence, here to teach and assist me.
|
| 34 |
-
- role: user
|
| 35 |
-
content: Write a short story about Goku discovering kirby has teamed up with Majin Buu to destroy the world.
|
| 36 |
-
pipeline_tag: text-generation
|
| 37 |
-
inference: false
|
| 38 |
-
quantized_by: Suparious
|
| 39 |
-
---
|
| 40 |
-
# NousResearch/Hermes-2-Pro-Llama-3-8B AWQ
|
| 41 |
-
|
| 42 |
-
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
streamer
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
#
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
|
| 100 |
-
return_tensors='pt').input_ids.cuda()
|
| 101 |
-
|
| 102 |
-
# Generate output
|
| 103 |
-
generation_output = model.generate(tokens,
|
| 104 |
-
streamer=streamer,
|
| 105 |
-
max_new_tokens=512)
|
| 106 |
-
```
|
| 107 |
-
|
| 108 |
-
### About AWQ
|
| 109 |
-
|
| 110 |
-
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.
|
| 111 |
-
|
| 112 |
-
AWQ models are currently supported on Linux and Windows, with NVidia GPUs only. macOS users: please use GGUF models instead.
|
| 113 |
-
|
| 114 |
-
It is supported by:
|
| 115 |
-
|
| 116 |
-
- [Text Generation Webui](https://github.com/oobabooga/text-generation-webui) - using Loader: AutoAWQ
|
| 117 |
-
- [vLLM](https://github.com/vllm-project/vllm) - version 0.2.2 or later for support for all model types.
|
| 118 |
-
- [Hugging Face Text Generation Inference (TGI)](https://github.com/huggingface/text-generation-inference)
|
| 119 |
-
- [Transformers](https://huggingface.co/docs/transformers) version 4.35.0 and later, from any code or client that supports Transformers
|
| 120 |
-
- [AutoAWQ](https://github.com/casper-hansen/AutoAWQ) - for use from Python code
|
|
|
|
| 1 |
+
---
|
| 2 |
+
library_name: transformers
|
| 3 |
+
tags:
|
| 4 |
+
- 4-bit
|
| 5 |
+
- AWQ
|
| 6 |
+
- text-generation
|
| 7 |
+
- autotrain_compatible
|
| 8 |
+
- endpoints_compatible
|
| 9 |
+
- Llama-3
|
| 10 |
+
- instruct
|
| 11 |
+
- finetune
|
| 12 |
+
- chatml
|
| 13 |
+
- DPO
|
| 14 |
+
- RLHF
|
| 15 |
+
- gpt4
|
| 16 |
+
- synthetic data
|
| 17 |
+
- distillation
|
| 18 |
+
- function calling
|
| 19 |
+
- json mode
|
| 20 |
+
- axolotl
|
| 21 |
+
model-index:
|
| 22 |
+
- name: Hermes-2-Pro-Llama-3-8B
|
| 23 |
+
results: []
|
| 24 |
+
license: apache-2.0
|
| 25 |
+
language:
|
| 26 |
+
- en
|
| 27 |
+
datasets:
|
| 28 |
+
- teknium/OpenHermes-2.5
|
| 29 |
+
widget:
|
| 30 |
+
- example_title: Hermes 2 Pro
|
| 31 |
+
messages:
|
| 32 |
+
- role: system
|
| 33 |
+
content: You are a sentient, superintelligent artificial general intelligence, here to teach and assist me.
|
| 34 |
+
- role: user
|
| 35 |
+
content: Write a short story about Goku discovering kirby has teamed up with Majin Buu to destroy the world.
|
| 36 |
+
pipeline_tag: text-generation
|
| 37 |
+
inference: false
|
| 38 |
+
quantized_by: Suparious
|
| 39 |
+
---
|
| 40 |
+
# NousResearch/Hermes-2-Pro-Llama-3-8B AWQ
|
| 41 |
+
|
| 42 |
+
- Original model: [Hermes-2-Pro-Llama-3-8B](https://huggingface.co/NousResearch/Hermes-2-Pro-Llama-3-8B)
|
| 43 |
+
|
| 44 |
+
```bash
|
| 45 |
+
pip install --upgrade autoawq autoawq-kernels
|
| 46 |
+
```
|
| 47 |
+
|
| 48 |
+
### Example Python code
|
| 49 |
+
|
| 50 |
+
```python
|
| 51 |
+
from awq import AutoAWQForCausalLM
|
| 52 |
+
from transformers import AutoTokenizer, TextStreamer
|
| 53 |
+
|
| 54 |
+
model_path = "solidrust/Hermes-2-Pro-Llama-3-8B-AWQ"
|
| 55 |
+
system_message = "You are Hermes-2-Pro-Llama-3-8B, incarnated as a powerful AI. You were created by NousResearch."
|
| 56 |
+
|
| 57 |
+
# Load model
|
| 58 |
+
model = AutoAWQForCausalLM.from_quantized(model_path,
|
| 59 |
+
fuse_layers=True)
|
| 60 |
+
tokenizer = AutoTokenizer.from_pretrained(model_path,
|
| 61 |
+
trust_remote_code=True)
|
| 62 |
+
streamer = TextStreamer(tokenizer,
|
| 63 |
+
skip_prompt=True,
|
| 64 |
+
skip_special_tokens=True)
|
| 65 |
+
|
| 66 |
+
# Convert prompt to tokens
|
| 67 |
+
prompt_template = """\
|
| 68 |
+
<|im_start|>system
|
| 69 |
+
{system_message}<|im_end|>
|
| 70 |
+
<|im_start|>user
|
| 71 |
+
{prompt}<|im_end|>
|
| 72 |
+
<|im_start|>assistant"""
|
| 73 |
+
|
| 74 |
+
prompt = "You're standing on the surface of the Earth. "\
|
| 75 |
+
"You walk one mile south, one mile west and one mile north. "\
|
| 76 |
+
"You end up exactly where you started. Where are you?"
|
| 77 |
+
|
| 78 |
+
tokens = tokenizer(prompt_template.format(system_message=system_message,prompt=prompt),
|
| 79 |
+
return_tensors='pt').input_ids.cuda()
|
| 80 |
+
|
| 81 |
+
# Generate output
|
| 82 |
+
generation_output = model.generate(tokens,
|
| 83 |
+
streamer=streamer,
|
| 84 |
+
max_new_tokens=512)
|
| 85 |
+
```
|
| 86 |
+
|
| 87 |
+
### About AWQ
|
| 88 |
+
|
| 89 |
+
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.
|
| 90 |
+
|
| 91 |
+
AWQ models are currently supported on Linux and Windows, with NVidia GPUs only. macOS users: please use GGUF models instead.
|
| 92 |
+
|
| 93 |
+
It is supported by:
|
| 94 |
+
|
| 95 |
+
- [Text Generation Webui](https://github.com/oobabooga/text-generation-webui) - using Loader: AutoAWQ
|
| 96 |
+
- [vLLM](https://github.com/vllm-project/vllm) - version 0.2.2 or later for support for all model types.
|
| 97 |
+
- [Hugging Face Text Generation Inference (TGI)](https://github.com/huggingface/text-generation-inference)
|
| 98 |
+
- [Transformers](https://huggingface.co/docs/transformers) version 4.35.0 and later, from any code or client that supports Transformers
|
| 99 |
+
- [AutoAWQ](https://github.com/casper-hansen/AutoAWQ) - for use from Python code
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|