Triangle104 commited on
Commit
a4fe715
·
verified ·
1 Parent(s): 47e903f

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +221 -0
README.md CHANGED
@@ -17,6 +17,227 @@ tags:
17
  This model was converted to GGUF format from [`prithivMLmods/GWQ-9B-Preview2`](https://huggingface.co/prithivMLmods/GWQ-9B-Preview2) using llama.cpp via the ggml.ai's [GGUF-my-repo](https://huggingface.co/spaces/ggml-org/gguf-my-repo) space.
18
  Refer to the [original model card](https://huggingface.co/prithivMLmods/GWQ-9B-Preview2) for more details on the model.
19
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
20
  ## Use with llama.cpp
21
  Install llama.cpp through brew (works on Mac and Linux)
22
 
 
17
  This model was converted to GGUF format from [`prithivMLmods/GWQ-9B-Preview2`](https://huggingface.co/prithivMLmods/GWQ-9B-Preview2) using llama.cpp via the ggml.ai's [GGUF-my-repo](https://huggingface.co/spaces/ggml-org/gguf-my-repo) space.
18
  Refer to the [original model card](https://huggingface.co/prithivMLmods/GWQ-9B-Preview2) for more details on the model.
19
 
20
+ ---
21
+ Model details:
22
+ -
23
+ GWQ2 - Gemma with Questions Prev is a family of lightweight,
24
+ state-of-the-art open models from Google, built using the same research
25
+ and technology employed to create the Gemini models. These models are
26
+ text-to-text, decoder-only large language models, available in English,
27
+ with open weights for both pre-trained and instruction-tuned variants.
28
+ Gemma models are well-suited for a variety of text generation tasks,
29
+ including question answering, summarization, and reasoning. GWQ is
30
+ fine-tuned on the Chain of Continuous Thought Synthetic Dataset, built
31
+ upon the Gemma2forCasualLM architecture.
32
+
33
+
34
+
35
+
36
+
37
+
38
+
39
+ Running GWQ Demo
40
+
41
+
42
+
43
+
44
+ # pip install accelerate
45
+ from transformers import AutoTokenizer, AutoModelForCausalLM
46
+ import torch
47
+
48
+ tokenizer = AutoTokenizer.from_pretrained("prithivMLmods/GWQ-9B-Preview2")
49
+ model = AutoModelForCausalLM.from_pretrained(
50
+ "prithivMLmods/GWQ-9B-Preview2",
51
+ device_map="auto",
52
+ torch_dtype=torch.bfloat16,
53
+ )
54
+
55
+ input_text = "Write me a poem about Machine Learning."
56
+ input_ids = tokenizer(input_text, return_tensors="pt").to("cuda")
57
+
58
+ outputs = model.generate(**input_ids, max_new_tokens=32)
59
+ print(tokenizer.decode(outputs[0]))
60
+
61
+
62
+
63
+ You can ensure the correct chat template is applied by using tokenizer.apply_chat_template as follows:
64
+
65
+
66
+ messages = [
67
+ {"role": "user", "content": "Write me a poem about Machine Learning."},
68
+ ]
69
+ input_ids = tokenizer.apply_chat_template(messages, return_tensors="pt", return_dict=True).to("cuda")
70
+
71
+ outputs = model.generate(**input_ids, max_new_tokens=256)
72
+ print(tokenizer.decode(outputs[0]))
73
+
74
+
75
+
76
+
77
+
78
+
79
+
80
+
81
+ Key Architecture
82
+
83
+
84
+
85
+
86
+ Transformer-Based Design:
87
+ Gemma 2 leverages
88
+ the transformer architecture, utilizing self-attention mechanisms to
89
+ process input text and capture contextual relationships effectively.
90
+
91
+
92
+ Lightweight and Efficient:
93
+ It is designed to
94
+ be computationally efficient, with fewer parameters compared to larger
95
+ models, making it ideal for deployment on resource-constrained devices
96
+ or environments.
97
+
98
+
99
+ Modular Layers:
100
+ The architecture consists of
101
+ modular encoder and decoder layers, allowing flexibility in adapting the
102
+ model for specific tasks like text generation, summarization, or
103
+ classification.
104
+
105
+
106
+ Attention Mechanisms:
107
+ Gemma 2 employs
108
+ multi-head self-attention to focus on relevant parts of the input text,
109
+ improving its ability to handle long-range dependencies and complex
110
+ language structures.
111
+
112
+
113
+ Pre-training and Fine-Tuning:
114
+ The model is
115
+ pre-trained on large text corpora and can be fine-tuned for specific
116
+ tasks, such as markdown processing in ReadM.Md, to enhance its
117
+ performance on domain-specific data.
118
+
119
+
120
+ Scalability:
121
+ The architecture supports scaling up or down based on the application's requirements, balancing performance and resource usage.
122
+
123
+
124
+ Open-Source and Customizable:
125
+ Being
126
+ open-source, Gemma 2 allows developers to modify and extend its
127
+ architecture to suit specific use cases, such as integrating it into
128
+ tools like ReadM.Md for markdown-related tasks.
129
+
130
+
131
+
132
+
133
+
134
+
135
+
136
+
137
+
138
+ Intended Use of GWQ2 (Gemma with Questions2)
139
+
140
+
141
+
142
+
143
+ Question Answering:
144
+ The model excels in generating concise and relevant answers to user-provided queries across various domains.
145
+
146
+
147
+ Summarization:
148
+ It can be used to summarize
149
+ large bodies of text, making it suitable for news aggregation, academic
150
+ research, and report generation.
151
+
152
+
153
+ Reasoning Tasks:
154
+ GWQ is fine-tuned on the
155
+ Chain of Continuous Thought Synthetic Dataset, which enhances its
156
+ ability to perform reasoning, multi-step problem solving, and logical
157
+ inferences.
158
+
159
+
160
+ Text Generation:
161
+ The model is ideal for
162
+ creative writing tasks such as generating poems, stories, and essays. It
163
+ can also be used for generating code comments, documentation, and
164
+ markdown files.
165
+
166
+
167
+ Instruction Following:
168
+ GWQ’s
169
+ instruction-tuned variant is suitable for generating responses based on
170
+ user instructions, making it useful for virtual assistants, tutoring
171
+ systems, and automated customer support.
172
+
173
+
174
+ Domain-Specific Applications:
175
+ Thanks to its
176
+ modular design and open-source nature, the model can be fine-tuned for
177
+ specific tasks like legal document summarization, medical record
178
+ analysis, or financial report generation.
179
+
180
+
181
+
182
+
183
+
184
+
185
+
186
+
187
+
188
+ Limitations of GWQ2
189
+
190
+
191
+
192
+
193
+ Resource Requirements:
194
+ Although lightweight
195
+ compared to larger models, the 9B parameter size still requires
196
+ significant computational resources, including GPUs with large memory
197
+ for inference.
198
+
199
+
200
+ Knowledge Cutoff:
201
+ The model’s pre-training
202
+ data may not include recent information, making it less effective for
203
+ answering queries on current events or newly developed topics.
204
+
205
+
206
+ Bias in Outputs:
207
+ Since the model is trained
208
+ on publicly available datasets, it may inherit biases present in those
209
+ datasets, leading to potentially biased or harmful outputs in sensitive
210
+ contexts.
211
+
212
+
213
+ Hallucinations:
214
+ Like other large language
215
+ models, GWQ can occasionally generate incorrect or nonsensical
216
+ information, especially when asked for facts or reasoning outside its
217
+ training scope.
218
+
219
+
220
+ Lack of Common-Sense Reasoning:
221
+ While GWQ is
222
+ fine-tuned for reasoning, it may still struggle with tasks requiring
223
+ deep common-sense knowledge or nuanced understanding of human behavior
224
+ and emotions.
225
+
226
+
227
+ Dependency on Fine-Tuning:
228
+ For optimal
229
+ performance on domain-specific tasks, fine-tuning on relevant datasets
230
+ is required, which demands additional computational resources and
231
+ expertise.
232
+
233
+
234
+ Context Length Limitation:
235
+ The model’s
236
+ ability to process long documents is limited by its maximum context
237
+ window size. If the input exceeds this limit, truncation may lead to
238
+ loss of important information.
239
+
240
+ ---
241
  ## Use with llama.cpp
242
  Install llama.cpp through brew (works on Mac and Linux)
243