Suparious commited on
Commit
4ba72bd
·
verified ·
1 Parent(s): 36e8dd1

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +72 -1
README.md CHANGED
@@ -35,7 +35,8 @@ prompt_template: '<|im_start|>system
35
  ---
36
  # cognitivecomputations/dolphin-2.8-mistral-7b-v02 AWQ
37
 
38
-
 
39
 
40
  ## Model Summary
41
 
@@ -43,4 +44,74 @@ This model is a fine-tuned version of [alpindale/Mistral-7B-v0.2-hf](https://hug
43
  It achieves the following results on the evaluation set:
44
  - Loss: 0.4828
45
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
46
 
 
 
 
 
 
 
 
 
35
  ---
36
  # cognitivecomputations/dolphin-2.8-mistral-7b-v02 AWQ
37
 
38
+ - Model creator: [cognitivecomputations](https://huggingface.co/cognitivecomputations)
39
+ - Original model: [dolphin-2.8-mistral-7b-v02](https://huggingface.co/cognitivecomputations/dolphin-2.8-mistral-7b-v02)
40
 
41
  ## Model Summary
42
 
 
44
  It achieves the following results on the evaluation set:
45
  - Loss: 0.4828
46
 
47
+ ## How to use
48
+
49
+ ### Install the necessary packages
50
+
51
+ ```bash
52
+ pip install --upgrade autoawq autoawq-kernels
53
+ ```
54
+
55
+ ### Example Python code
56
+
57
+ ```python
58
+ from awq import AutoAWQForCausalLM
59
+ from transformers import AutoTokenizer, TextStreamer
60
+
61
+ model_path = "solidrust/Hyperion-1.5-Mistral-7B-AWQ"
62
+ system_message = "You are Hyperion, incarnated as a powerful AI."
63
+
64
+ # Load model
65
+ model = AutoAWQForCausalLM.from_quantized(model_path,
66
+ fuse_layers=True)
67
+ tokenizer = AutoTokenizer.from_pretrained(model_path,
68
+ trust_remote_code=True)
69
+ streamer = TextStreamer(tokenizer,
70
+ skip_prompt=True,
71
+ skip_special_tokens=True)
72
+
73
+ # Convert prompt to tokens
74
+ prompt_template = """\
75
+ <|im_start|>system
76
+ {system_message}<|im_end|>
77
+ <|im_start|>user
78
+ {prompt}<|im_end|>
79
+ <|im_start|>assistant"""
80
+
81
+ prompt = "You're standing on the surface of the Earth. "\
82
+ "You walk one mile south, one mile west and one mile north. "\
83
+ "You end up exactly where you started. Where are you?"
84
+
85
+ tokens = tokenizer(prompt_template.format(system_message=system_message,prompt=prompt),
86
+ return_tensors='pt').input_ids.cuda()
87
+
88
+ # Generate output
89
+ generation_output = model.generate(tokens,
90
+ streamer=streamer,
91
+ max_new_tokens=512)
92
+
93
+ ```
94
+
95
+ ### About AWQ
96
+
97
+ 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.
98
+
99
+ AWQ models are currently supported on Linux and Windows, with NVidia GPUs only. macOS users: please use GGUF models instead.
100
+
101
+ It is supported by:
102
+
103
+ - [Text Generation Webui](https://github.com/oobabooga/text-generation-webui) - using Loader: AutoAWQ
104
+ - [vLLM](https://github.com/vllm-project/vllm) - version 0.2.2 or later for support for all model types.
105
+ - [Hugging Face Text Generation Inference (TGI)](https://github.com/huggingface/text-generation-inference)
106
+ - [Transformers](https://huggingface.co/docs/transformers) version 4.35.0 and later, from any code or client that supports Transformers
107
+ - [AutoAWQ](https://github.com/casper-hansen/AutoAWQ) - for use from Python code
108
+
109
+ ## Prompt template: ChatML
110
 
111
+ ```plaintext
112
+ <|im_start|>system
113
+ {system_message}<|im_end|>
114
+ <|im_start|>user
115
+ {prompt}<|im_end|>
116
+ <|im_start|>assistant
117
+ ```