Suparious commited on
Commit
e96fdd4
1 Parent(s): 3eeffdd

Add model card

Browse files
Files changed (1) hide show
  1. README.md +123 -0
README.md CHANGED
@@ -1,3 +1,126 @@
1
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  license: apache-2.0
3
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
+ tags:
3
+ - merge
4
+ - mergekit
5
+ - lazymergekit
6
+ - Locutusque/Hercules-2.5-Mistral-7B
7
+ - openchat/openchat-3.5-0106
8
+ - quantized
9
+ - 4-bit
10
+ - AWQ
11
+ - transformers
12
+ - pytorch
13
+ - mistral
14
+ - text-generation
15
+ - conversational
16
+ - license:apache-2.0
17
+ - autotrain_compatible
18
+ - endpoints_compatible
19
+ - text-generation-inference
20
+ - chatml
21
+ base_model:
22
+ - Locutusque/Hercules-2.5-Mistral-7B
23
+ - openchat/openchat-3.5-0106
24
  license: apache-2.0
25
  ---
26
+ # ChatHercules-2.5-Mistral-7B
27
+
28
+ - Model creator: [hydra-project](https://huggingface.co/hydra-project)
29
+ - Original model: [ChatHercules-2.5-Mistral-7B](https://huggingface.co/hydra-project/ChatHercules-2.5-Mistral-7B)
30
+
31
+ ## Model Summary
32
+
33
+ ChatHercules-2.5-Mistral-7B is a merge of the following models using [LazyMergekit](https://colab.research.google.com/drive/1obulZ1ROXHjYLn6PPZJwRR6GzgQogxxb?usp=sharing):
34
+ * [Locutusque/Hercules-2.5-Mistral-7B](https://huggingface.co/Locutusque/Hercules-2.5-Mistral-7B)
35
+ * [openchat/openchat-3.5-0106](https://huggingface.co/openchat/openchat-3.5-0106)
36
+
37
+ ```yaml
38
+ slices:
39
+ - sources:
40
+ - model: Locutusque/Hercules-2.5-Mistral-7B
41
+ layer_range: [0, 32]
42
+ - model: openchat/openchat-3.5-0106
43
+ layer_range: [0, 32]
44
+ merge_method: slerp
45
+ base_model: Locutusque/Hercules-2.5-Mistral-7B
46
+ parameters:
47
+ t:
48
+ - filter: self_attn
49
+ value: [0, 0.5, 0.3, 0.7, 1]
50
+ - filter: mlp
51
+ value: [1, 0.5, 0.7, 0.3, 0]
52
+ - value: 0.5
53
+ dtype: bfloat16
54
+ ```
55
+
56
+ ## How to use
57
+
58
+ ### Install the necessary packages
59
+
60
+ ```bash
61
+ pip install --upgrade autoawq autoawq-kernels
62
+ ```
63
+
64
+ ### Example Python code
65
+
66
+ ```python
67
+ from awq import AutoAWQForCausalLM
68
+ from transformers import AutoTokenizer, TextStreamer
69
+
70
+ model_path = "solidrust/ChatHercules-2.5-Mistral-7B-AWQ"
71
+ system_message = "You are Hercules, incarnated as a powerful AI."
72
+
73
+ # Load model
74
+ model = AutoAWQForCausalLM.from_quantized(model_path,
75
+ fuse_layers=True)
76
+ tokenizer = AutoTokenizer.from_pretrained(model_path,
77
+ trust_remote_code=True)
78
+ streamer = TextStreamer(tokenizer,
79
+ skip_prompt=True,
80
+ skip_special_tokens=True)
81
+
82
+ # Convert prompt to tokens
83
+ prompt_template = """\
84
+ <|im_start|>system
85
+ {system_message}<|im_end|>
86
+ <|im_start|>user
87
+ {prompt}<|im_end|>
88
+ <|im_start|>assistant"""
89
+
90
+ prompt = "You're standing on the surface of the Earth. "\
91
+ "You walk one mile south, one mile west and one mile north. "\
92
+ "You end up exactly where you started. Where are you?"
93
+
94
+ tokens = tokenizer(prompt_template.format(system_message=system_message,prompt=prompt),
95
+ return_tensors='pt').input_ids.cuda()
96
+
97
+ # Generate output
98
+ generation_output = model.generate(tokens,
99
+ streamer=streamer,
100
+ max_new_tokens=512)
101
+
102
+ ```
103
+
104
+ ### About AWQ
105
+
106
+ 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.
107
+
108
+ AWQ models are currently supported on Linux and Windows, with NVidia GPUs only. macOS users: please use GGUF models instead.
109
+
110
+ It is supported by:
111
+
112
+ - [Text Generation Webui](https://github.com/oobabooga/text-generation-webui) - using Loader: AutoAWQ
113
+ - [vLLM](https://github.com/vllm-project/vllm) - version 0.2.2 or later for support for all model types.
114
+ - [Hugging Face Text Generation Inference (TGI)](https://github.com/huggingface/text-generation-inference)
115
+ - [Transformers](https://huggingface.co/docs/transformers) version 4.35.0 and later, from any code or client that supports Transformers
116
+ - [AutoAWQ](https://github.com/casper-hansen/AutoAWQ) - for use from Python code
117
+
118
+ ## Prompt template: ChatML
119
+
120
+ ```plaintext
121
+ <|im_start|>system
122
+ {system_message}<|im_end|>
123
+ <|im_start|>user
124
+ {prompt}<|im_end|>
125
+ <|im_start|>assistant
126
+ ```