aashish1904 commited on
Commit
ab4c678
·
verified ·
1 Parent(s): 51cc0b6

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +126 -0
README.md ADDED
@@ -0,0 +1,126 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ ---
3
+
4
+ license: gemma
5
+ language:
6
+ - en
7
+ pipeline_tag: text-generation
8
+ library_name: transformers
9
+ tags:
10
+ - gemma2
11
+ - text-generation-inference
12
+ - f16
13
+
14
+ ---
15
+
16
+ [![QuantFactory Banner](https://lh7-rt.googleusercontent.com/docsz/AD_4nXeiuCm7c8lEwEJuRey9kiVZsRn2W-b4pWlu3-X534V3YmVuVc2ZL-NXg2RkzSOOS2JXGHutDuyyNAUtdJI65jGTo8jT9Y99tMi4H4MqL44Uc5QKG77B0d6-JfIkZHFaUA71-RtjyYZWVIhqsNZcx8-OMaA?key=xt3VSDoCbmTY7o-cwwOFwQ)](https://hf.co/QuantFactory)
17
+
18
+
19
+ # QuantFactory/GWQ-9B-Preview-GGUF
20
+ This is quantized version of [prithivMLmods/GWQ-9B-Preview](https://huggingface.co/prithivMLmods/GWQ-9B-Preview) created using llama.cpp
21
+
22
+ # Original Model Card
23
+
24
+ ![gwq.png](https://cdn-uploads.huggingface.co/production/uploads/65bb837dbfb878f46c77de4c/OSjnMjpPnapGr4Kguuh2O.png)
25
+
26
+ # **GWQ-9B-Preview**
27
+
28
+ GWQ - Gemma with Questions Prev is a family of lightweight, state-of-the-art open model base from Google, built using the same research and technology employed to create the Gemini models. These models are text-to-text, decoder-only large language models, available in English, with open weights for both pre-trained and instruction-tuned variants. Gemma models are well-suited for a variety of text generation tasks, including question answering, summarization, and reasoning. GWQ is fine-tuned on the Chain of Continuous Thought Synthetic Dataset, built upon the Gemma2forCasualLM architecture.
29
+
30
+ # **Running GWQ Demo**
31
+
32
+ ```python
33
+ # pip install accelerate
34
+ from transformers import AutoTokenizer, AutoModelForCausalLM
35
+ import torch
36
+
37
+ tokenizer = AutoTokenizer.from_pretrained("prithivMLmods/GWQ-9B-Preview")
38
+ model = AutoModelForCausalLM.from_pretrained(
39
+ "prithivMLmods/GWQ-9B-Preview",
40
+ device_map="auto",
41
+ torch_dtype=torch.bfloat16,
42
+ )
43
+
44
+ input_text = "Write me a poem about Machine Learning."
45
+ input_ids = tokenizer(input_text, return_tensors="pt").to("cuda")
46
+
47
+ outputs = model.generate(**input_ids, max_new_tokens=32)
48
+ print(tokenizer.decode(outputs[0]))
49
+ ```
50
+
51
+ You can ensure the correct chat template is applied by using `tokenizer.apply_chat_template` as follows:
52
+ ```python
53
+ messages = [
54
+ {"role": "user", "content": "Write me a poem about Machine Learning."},
55
+ ]
56
+ input_ids = tokenizer.apply_chat_template(messages, return_tensors="pt", return_dict=True).to("cuda")
57
+
58
+ outputs = model.generate(**input_ids, max_new_tokens=256)
59
+ print(tokenizer.decode(outputs[0]))
60
+ ```
61
+
62
+ # **Key Architecture**
63
+
64
+ 1. **Transformer-Based Design**:
65
+ Gemma 2 leverages the transformer architecture, utilizing self-attention mechanisms to process input text and capture contextual relationships effectively.
66
+
67
+ 2. **Lightweight and Efficient**:
68
+ It is designed to be computationally efficient, with fewer parameters compared to larger models, making it ideal for deployment on resource-constrained devices or environments.
69
+
70
+ 3. **Modular Layers**:
71
+ The architecture consists of modular encoder and decoder layers, allowing flexibility in adapting the model for specific tasks like text generation, summarization, or classification.
72
+
73
+ 4. **Attention Mechanisms**:
74
+ Gemma 2 employs multi-head self-attention to focus on relevant parts of the input text, improving its ability to handle long-range dependencies and complex language structures.
75
+
76
+ 5. **Pre-training and Fine-Tuning**:
77
+ The model is pre-trained on large text corpora and can be fine-tuned for specific tasks, such as markdown processing in ReadM.Md, to enhance its performance on domain-specific data.
78
+
79
+ 6. **Scalability**:
80
+ The architecture supports scaling up or down based on the application's requirements, balancing performance and resource usage.
81
+
82
+ 7. **Open-Source and Customizable**:
83
+ Being open-source, Gemma 2 allows developers to modify and extend its architecture to suit specific use cases, such as integrating it into tools like ReadM.Md for markdown-related tasks.
84
+
85
+ # **Intended Use of GWQ (Gemma with Questions)**
86
+
87
+ 1. **Question Answering:**
88
+ The model excels in generating concise and relevant answers to user-provided queries across various domains.
89
+
90
+ 2. **Summarization:**
91
+ It can be used to summarize large bodies of text, making it suitable for news aggregation, academic research, and report generation.
92
+
93
+ 3. **Reasoning Tasks:**
94
+ GWQ is fine-tuned on the Chain of Continuous Thought Synthetic Dataset, which enhances its ability to perform reasoning, multi-step problem solving, and logical inferences.
95
+
96
+ 4. **Text Generation:**
97
+ The model is ideal for creative writing tasks such as generating poems, stories, and essays. It can also be used for generating code comments, documentation, and markdown files.
98
+
99
+ 5. **Instruction Following:**
100
+ GWQ’s instruction-tuned variant is suitable for generating responses based on user instructions, making it useful for virtual assistants, tutoring systems, and automated customer support.
101
+
102
+ 6. **Domain-Specific Applications:**
103
+ Thanks to its modular design and open-source nature, the model can be fine-tuned for specific tasks like legal document summarization, medical record analysis, or financial report generation.
104
+
105
+ ## **Limitations of GWQ**
106
+
107
+ 1. **Resource Requirements:**
108
+ Although lightweight compared to larger models, the 9B parameter size still requires significant computational resources, including GPUs with large memory for inference.
109
+
110
+ 2. **Knowledge Cutoff:**
111
+ The model’s pre-training data may not include recent information, making it less effective for answering queries on current events or newly developed topics.
112
+
113
+ 3. **Bias in Outputs:**
114
+ Since the model is trained on publicly available datasets, it may inherit biases present in those datasets, leading to potentially biased or harmful outputs in sensitive contexts.
115
+
116
+ 4. **Hallucinations:**
117
+ Like other large language models, GWQ can occasionally generate incorrect or nonsensical information, especially when asked for facts or reasoning outside its training scope.
118
+
119
+ 5. **Lack of Common-Sense Reasoning:**
120
+ While GWQ is fine-tuned for reasoning, it may still struggle with tasks requiring deep common-sense knowledge or nuanced understanding of human behavior and emotions.
121
+
122
+ 6. **Dependency on Fine-Tuning:**
123
+ For optimal performance on domain-specific tasks, fine-tuning on relevant datasets is required, which demands additional computational resources and expertise.
124
+
125
+ 7. **Context Length Limitation:**
126
+ The model’s ability to process long documents is limited by its maximum context window size. If the input exceeds this limit, truncation may lead to loss of important information.