Suparious commited on
Commit
347b4e1
·
verified ·
1 Parent(s): c51f178

Update model card

Browse files
Files changed (1) hide show
  1. README.md +122 -0
README.md CHANGED
@@ -1,3 +1,125 @@
1
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  license: apache-2.0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
+ library_name: transformers
3
+ tags:
4
+ - medical
5
+ - science
6
+ - biology
7
+ - chemistry
8
+ - not-for-all-audiences
9
+ - quantized
10
+ - 4-bit
11
+ - AWQ
12
+ - text-generation
13
+ - autotrain_compatible
14
+ - endpoints_compatible
15
+ - chatml
16
  license: apache-2.0
17
+ datasets:
18
+ - Locutusque/hercules-v4.0
19
+ language:
20
+ - en
21
+ model_creator: Locutusque
22
+ model_name: Hercules-4.0-Mistral-v0.2-7B
23
+ base_model: alpindale/Mistral-7B-v0.2-hf
24
+ model_type: mistral
25
+ pipeline_tag: text-generation
26
+ inference: false
27
+ prompt_template: '<|im_start|>system
28
+
29
+ {system_message}<|im_end|>
30
+
31
+ <|im_start|>user
32
+
33
+ {prompt}<|im_end|>
34
+
35
+ <|im_start|>assistant
36
+
37
+ '
38
+ quantized_by: Suparious
39
  ---
40
+ # Locutusque/Hercules-4.0-Mistral-v0.2-7B AWQ
41
+
42
+ - Model creator: [Locutusque](https://huggingface.co/Locutusque)
43
+ - Original model: [Hercules-4.0-Mistral-v0.2-7B](https://huggingface.co/Locutusque/Hercules-4.0-Mistral-v0.2-7B)
44
+
45
+ ![image/png](https://tse3.mm.bing.net/th/id/OIG1.vnrl3xpEcypR3McLW63q?pid=ImgGn)
46
+
47
+ ## Model Summary
48
+
49
+ Hercules-4.0-Mistral-v0.2-7B is a fine-tuned language model derived from Mistralai/Mistral-7B-v0.2. It is specifically designed to excel in instruction following, function calls, and conversational interactions across various scientific and technical domains. The dataset used for fine-tuning, also named Hercules-v4.0, expands upon the diverse capabilities of OpenHermes-2.5 with contributions from numerous curated datasets. This fine-tuning has hercules-v4.0 with enhanced abilities in:
50
+
51
+ - Complex Instruction Following: Understanding and accurately executing multi-step instructions, even those involving specialized terminology.
52
+ - Function Calling: Seamlessly interpreting and executing function calls, providing appropriate input and output values.
53
+ - Domain-Specific Knowledge: Engaging in informative and educational conversations about Biology, Chemistry, Physics, Mathematics, Medicine, Computer Science, and more.
54
+
55
+ ## How to use
56
+
57
+ ### Install the necessary packages
58
+
59
+ ```bash
60
+ pip install --upgrade autoawq autoawq-kernels
61
+ ```
62
+
63
+ ### Example Python code
64
+
65
+ ```python
66
+ from awq import AutoAWQForCausalLM
67
+ from transformers import AutoTokenizer, TextStreamer
68
+
69
+ model_path = "solidrust/Hercules-4.0-Mistral-v0.2-7B-AWQ"
70
+ system_message = "You are Hercules, incarnated as a powerful AI."
71
+
72
+ # Load model
73
+ model = AutoAWQForCausalLM.from_quantized(model_path,
74
+ fuse_layers=True)
75
+ tokenizer = AutoTokenizer.from_pretrained(model_path,
76
+ trust_remote_code=True)
77
+ streamer = TextStreamer(tokenizer,
78
+ skip_prompt=True,
79
+ skip_special_tokens=True)
80
+
81
+ # Convert prompt to tokens
82
+ prompt_template = """\
83
+ <|im_start|>system
84
+ {system_message}<|im_end|>
85
+ <|im_start|>user
86
+ {prompt}<|im_end|>
87
+ <|im_start|>assistant"""
88
+
89
+ prompt = "You're standing on the surface of the Earth. "\
90
+ "You walk one mile south, one mile west and one mile north. "\
91
+ "You end up exactly where you started. Where are you?"
92
+
93
+ tokens = tokenizer(prompt_template.format(system_message=system_message,prompt=prompt),
94
+ return_tensors='pt').input_ids.cuda()
95
+
96
+ # Generate output
97
+ generation_output = model.generate(tokens,
98
+ streamer=streamer,
99
+ max_new_tokens=512)
100
+
101
+ ```
102
+
103
+ ### About AWQ
104
+
105
+ 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.
106
+
107
+ AWQ models are currently supported on Linux and Windows, with NVidia GPUs only. macOS users: please use GGUF models instead.
108
+
109
+ It is supported by:
110
+
111
+ - [Text Generation Webui](https://github.com/oobabooga/text-generation-webui) - using Loader: AutoAWQ
112
+ - [vLLM](https://github.com/vllm-project/vllm) - version 0.2.2 or later for support for all model types.
113
+ - [Hugging Face Text Generation Inference (TGI)](https://github.com/huggingface/text-generation-inference)
114
+ - [Transformers](https://huggingface.co/docs/transformers) version 4.35.0 and later, from any code or client that supports Transformers
115
+ - [AutoAWQ](https://github.com/casper-hansen/AutoAWQ) - for use from Python code
116
+
117
+ ## Prompt template: ChatML
118
+
119
+ ```plaintext
120
+ <|im_start|>system
121
+ {system_message}<|im_end|>
122
+ <|im_start|>user
123
+ {prompt}<|im_end|>
124
+ <|im_start|>assistant
125
+ ```