Kronikus commited on
Commit
f269e68
1 Parent(s): 1ebaa91

Add model card

Browse files
Files changed (1) hide show
  1. README.md +125 -0
README.md CHANGED
@@ -1,3 +1,128 @@
1
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  license: apache-2.0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
+ base_model: mistralai/Mistral-7B-v0.1
3
+ tags:
4
+ - Mistral
5
+ - instruct
6
+ - finetune
7
+ - synthetic
8
+ - quantized
9
+ - 4-bit
10
+ - AWQ
11
+ - text-generation
12
+ - autotrain_compatible
13
+ - endpoints_compatible
14
+ - chatml
15
  license: apache-2.0
16
+ language:
17
+ - en
18
+ library_name: transformers
19
+ model_creator: NousResearch
20
+ model_name: Genstruct-7B
21
+ model_type: mistral
22
+ pipeline_tag: text-generation
23
+ inference: false
24
+ prompt_template: '<|im_start|>system
25
+
26
+ {system_message}<|im_end|>
27
+
28
+ <|im_start|>user
29
+
30
+ {prompt}<|im_end|>
31
+
32
+ <|im_start|>assistant
33
+
34
+ '
35
+ quantized_by: Suparious
36
  ---
37
+ # NousResearch/Genstruct-7B AWQ
38
+
39
+ **UPLOAD IN PROGRESS**
40
+
41
+ - Model creator: [mlabonne](https://huggingface.co/mlabonne)
42
+ - Original model: [Darewin-7B](https://huggingface.co/mlabonne/Darewin-7B)
43
+
44
+ ![image/png](https://cdn-uploads.huggingface.co/production/uploads/64137e2150358a805203cbac/ZhntfiUrRzRtB16nQb_1e.png)
45
+
46
+ ## Model Summary
47
+
48
+ Genstruct 7B is an instruction-generation model, designed to create valid instructions given a raw text corpus. This enables the creation of new, partially synthetic instruction finetuning datasets from any raw-text corpus.
49
+
50
+ This work was inspired by [Ada-Instruct](https://arxiv.org/abs/2310.04484)
51
+
52
+ Previous methods largely rely on in-context approaches to generate instructions, while Ada-Instruct trained a custom instruction-generation model.
53
+
54
+ Inspired by this, we took this approach further by grounding the generations in user-provided context passages.
55
+
56
+ Further, the model is trained to generate questions involving complex scenarios that require detailed reasoning, allowing for models trained on the generated data to reason step-by-step.
57
+
58
+ ## How to use
59
+
60
+ ### Install the necessary packages
61
+
62
+ ```bash
63
+ pip install --upgrade autoawq autoawq-kernels
64
+ ```
65
+
66
+ ### Example Python code
67
+
68
+ ```python
69
+ from awq import AutoAWQForCausalLM
70
+ from transformers import AutoTokenizer, TextStreamer
71
+
72
+ model_path = "solidrust/Genstruct-7B-AWQ"
73
+ system_message = "You are Genstruct, incarnated as a powerful AI."
74
+
75
+ # Load model
76
+ model = AutoAWQForCausalLM.from_quantized(model_path,
77
+ fuse_layers=True)
78
+ tokenizer = AutoTokenizer.from_pretrained(model_path,
79
+ trust_remote_code=True)
80
+ streamer = TextStreamer(tokenizer,
81
+ skip_prompt=True,
82
+ skip_special_tokens=True)
83
+
84
+ # Convert prompt to tokens
85
+ prompt_template = """\
86
+ <|im_start|>system
87
+ {system_message}<|im_end|>
88
+ <|im_start|>user
89
+ {prompt}<|im_end|>
90
+ <|im_start|>assistant"""
91
+
92
+ prompt = "You're standing on the surface of the Earth. "\
93
+ "You walk one mile south, one mile west and one mile north. "\
94
+ "You end up exactly where you started. Where are you?"
95
+
96
+ tokens = tokenizer(prompt_template.format(system_message=system_message,prompt=prompt),
97
+ return_tensors='pt').input_ids.cuda()
98
+
99
+ # Generate output
100
+ generation_output = model.generate(tokens,
101
+ streamer=streamer,
102
+ max_new_tokens=512)
103
+
104
+ ```
105
+
106
+ ### About AWQ
107
+
108
+ 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.
109
+
110
+ AWQ models are currently supported on Linux and Windows, with NVidia GPUs only. macOS users: please use GGUF models instead.
111
+
112
+ It is supported by:
113
+
114
+ - [Text Generation Webui](https://github.com/oobabooga/text-generation-webui) - using Loader: AutoAWQ
115
+ - [vLLM](https://github.com/vllm-project/vllm) - version 0.2.2 or later for support for all model types.
116
+ - [Hugging Face Text Generation Inference (TGI)](https://github.com/huggingface/text-generation-inference)
117
+ - [Transformers](https://huggingface.co/docs/transformers) version 4.35.0 and later, from any code or client that supports Transformers
118
+ - [AutoAWQ](https://github.com/casper-hansen/AutoAWQ) - for use from Python code
119
+
120
+ ## Prompt template: ChatML
121
+
122
+ ```plaintext
123
+ <|im_start|>system
124
+ {system_message}<|im_end|>
125
+ <|im_start|>user
126
+ {prompt}<|im_end|>
127
+ <|im_start|>assistant
128
+ ```