Update README.md
Browse files
README.md
CHANGED
@@ -16,33 +16,315 @@ extra_gated_button_content: Acknowledge license
|
|
16 |
license: gemma
|
17 |
quantized_by: bartowski
|
18 |
pipeline_tag: text-generation
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
19 |
---
|
20 |
|
21 |
-
##
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
16 |
license: gemma
|
17 |
quantized_by: bartowski
|
18 |
pipeline_tag: text-generation
|
19 |
+
lm_studio:
|
20 |
+
param_count: 2b
|
21 |
+
use_case: general
|
22 |
+
release_date: 05-04-2024
|
23 |
+
model_creator: google
|
24 |
+
prompt_template: Google Gemma Instruct
|
25 |
+
system_prompt: none
|
26 |
+
base_model: gemma
|
27 |
+
original_repo: google/gemma-1.1-2b-it
|
28 |
---
|
29 |
|
30 |
+
## 💫 Community Model> Gemma 1.1 2b Instruct by Google
|
31 |
+
|
32 |
+
*👾 [LM Studio](https://lmstudio.ai) Community models highlights program. Highlighting new & noteworthy models by the community. Join the conversation on [Discord](https://discord.gg/aPQfnNkxGC)*.
|
33 |
+
|
34 |
+
**Model creator:** [Google](https://huggingface.co/google)<br>
|
35 |
+
**Original model**: [gemma-1.1-2b-it](https://huggingface.co/google/gemma-1.1-2b-it)<br>
|
36 |
+
**GGUF quantization:** provided by [bartowski](https://huggingface.co/bartowski) based on `llama.cpp` release [b2589](https://github.com/ggerganov/llama.cpp/releases/tag/b2589)<br>
|
37 |
+
|
38 |
+
## Model Summary:
|
39 |
+
Gemma 1.1 instruct is a followup to Google's initial Gemma release. Compared to the first iteration, this model features substantial gains in quality, coding capabilities, factuality, instruction following and multi-turn conversation quality.<br>
|
40 |
+
As an instruction following model, this can be used for any number of use cases, including conversation and coding.<br>
|
41 |
+
At only 2b parameters, this model is great for people with low resources or who want an extremely fast response time for things like autocomplete or just generally rapid replies, while still giving extremely coherent answers.<br>
|
42 |
+
This model tends to reply in a more educational style, rather than truly conversational as you might expect, but does provide very thorough and detailed answers.
|
43 |
+
|
44 |
+
## Prompt Template:
|
45 |
+
|
46 |
+
Choose the 'Google Gemma Instruct' preset in your LM Studio.
|
47 |
+
|
48 |
+
Under the hood, the model will see a prompt that's formatted like so:
|
49 |
+
|
50 |
+
```
|
51 |
+
<start_of_turn>user
|
52 |
+
{prompt}<end_of_turn>
|
53 |
+
<start_of_turn>model
|
54 |
+
```
|
55 |
+
|
56 |
+
Note that this model does not support a System prompt.
|
57 |
+
|
58 |
+
## Use case and examples
|
59 |
+
|
60 |
+
The Gemma series of models is at its best when used for creativity, question answering, multi turn conversations, and coding.
|
61 |
+
|
62 |
+
### Creativity
|
63 |
+
|
64 |
+
```
|
65 |
+
<start_of_turn>user
|
66 |
+
Write me a poem about Machine Learning.<end_of_turn>
|
67 |
+
<start_of_turn>model
|
68 |
+
**Machine Learning**
|
69 |
+
|
70 |
+
In circuits deep, where data flows,
|
71 |
+
Algorithms dance, a wondrous show.
|
72 |
+
Machines learn, from vast and wide,
|
73 |
+
Insights hidden, in patterns tied.
|
74 |
+
|
75 |
+
From pixels seen, to words untold,
|
76 |
+
Insights emerge, stories unfold.
|
77 |
+
Through neural nets, a symphony of thought,
|
78 |
+
Connecting knowledge, a digital lot.
|
79 |
+
|
80 |
+
Data as fuel, a constant flow,
|
81 |
+
Learning patterns, ever low.
|
82 |
+
From regression's line to classification's task,
|
83 |
+
Machine learning unlocks a wondrous space.
|
84 |
+
|
85 |
+
In healthcare, it diagnoses with grace,
|
86 |
+
Predicting outcomes, with uncanny pace.
|
87 |
+
In finance, it guides investment wise,
|
88 |
+
Optimizing portfolios, with uncanny guise.
|
89 |
+
|
90 |
+
From self-driving cars to medical aid,
|
91 |
+
Machine learning's impact cannot be swayed.
|
92 |
+
It revolutionizes, with each passing day,
|
93 |
+
A future bright, where possibilities sway.
|
94 |
+
|
95 |
+
So let us embrace this wondrous art,
|
96 |
+
Machine learning, a gift from the start.
|
97 |
+
For in its depths, a world unseen,
|
98 |
+
Where knowledge and progress are truly keen.<end_of_turn>
|
99 |
+
```
|
100 |
+
|
101 |
+
### Coding
|
102 |
+
|
103 |
+
Note, the following code works if you move the partition function above the quicksort function, but original model output provided below for accuracy.
|
104 |
+
|
105 |
+
```
|
106 |
+
<start_of_turn>user
|
107 |
+
Implement quicksort using C++<end_of_turn>
|
108 |
+
<start_of_turn>model
|
109 |
+
|
110 |
+
#include <iostream>
|
111 |
+
#include <vector>
|
112 |
+
|
113 |
+
using namespace std;
|
114 |
+
|
115 |
+
void quicksort(vector<int>& arr, int low, int high)
|
116 |
+
{
|
117 |
+
if (low < high)
|
118 |
+
{
|
119 |
+
int partition_index = partition(arr, low, high);
|
120 |
+
|
121 |
+
quicksort(arr, low, partition_index - 1);
|
122 |
+
quicksort(arr, partition_index + 1, high);
|
123 |
+
}
|
124 |
+
}
|
125 |
+
|
126 |
+
int partition(vector<int>& arr, int low, int high)
|
127 |
+
{
|
128 |
+
int pivot = arr[high];
|
129 |
+
int i = (low - 1);
|
130 |
+
|
131 |
+
for (int j = low; j < high; j++)
|
132 |
+
{
|
133 |
+
if (arr[j] < pivot)
|
134 |
+
{
|
135 |
+
i++;
|
136 |
+
|
137 |
+
swap(arr[i], arr[j]);
|
138 |
+
}
|
139 |
+
}
|
140 |
+
|
141 |
+
swap(arr[i + 1], arr[high]);
|
142 |
+
return (i + 1);
|
143 |
+
}
|
144 |
+
|
145 |
+
int main()
|
146 |
+
{
|
147 |
+
vector<int> arr = {6, 4, 2, 8, 1, 5, 3, 7, 9};
|
148 |
+
|
149 |
+
cout << "Unsorted array: ";
|
150 |
+
for (int element : arr)
|
151 |
+
{
|
152 |
+
cout << element << " ";
|
153 |
+
}
|
154 |
+
|
155 |
+
quicksort(arr, 0, arr.size() - 1);
|
156 |
+
|
157 |
+
cout << endl;
|
158 |
+
|
159 |
+
cout << "Sorted array: ";
|
160 |
+
for (int element : arr)
|
161 |
+
{
|
162 |
+
cout << element << " ";
|
163 |
+
}
|
164 |
+
|
165 |
+
return 0;
|
166 |
+
}
|
167 |
+
|
168 |
+
|
169 |
+
**Explanation:**
|
170 |
+
|
171 |
+
* The `quicksort()` function recursively divides the array into smaller parts until the subarrays become empty.
|
172 |
+
* The `partition()` function selects a pivot element and partitions the array into two subarrays: elements smaller than the pivot go to the left subarray, and elements greater than the pivot go to the right subarray.
|
173 |
+
* The pivot element is swapped with the element in the right subarray.
|
174 |
+
|
175 |
+
**Time Complexity:**
|
176 |
+
|
177 |
+
* Best case: O(n log n)
|
178 |
+
* Average case: O(n log n)
|
179 |
+
* Worst case: O(n^2)
|
180 |
+
|
181 |
+
**Space Complexity:**
|
182 |
+
|
183 |
+
* O(1) for the recursive call stack.
|
184 |
+
* O(n) for the temporary storage used during the partitioning.<end_of_turn>
|
185 |
+
```
|
186 |
+
|
187 |
+
### Conversational
|
188 |
+
|
189 |
+
```
|
190 |
+
<bos><start_of_turn>user
|
191 |
+
How does the brain work?<end_of_turn>
|
192 |
+
<start_of_turn>model
|
193 |
+
**The brain is a complex organ with billions of neurons and synapses that work together to control all bodily functions.**
|
194 |
+
|
195 |
+
**Structure of the Brain:**
|
196 |
+
|
197 |
+
* **Neurons:** Basic functional units of the brain that transmit electrical signals.
|
198 |
+
* **Synapses:** Points of contact between neurons where chemical or electrical signals are transferred.
|
199 |
+
* **Dendrites:** Extensions of neurons that receive signals.
|
200 |
+
* **Axons:** Extensions of neurons that transmit signals away from the brain.
|
201 |
+
|
202 |
+
**Function of the Brain:**
|
203 |
+
|
204 |
+
**1. Sensory Function:**
|
205 |
+
* Receiving and interpreting sensory information from the body and environment.
|
206 |
+
* Processing and interpreting sensory data.
|
207 |
+
|
208 |
+
**2. Motor Function:**
|
209 |
+
* Sending signals to muscles to control movement.
|
210 |
+
* Coordinating and regulating muscle activity.
|
211 |
+
|
212 |
+
**3. Cognitive Function:**
|
213 |
+
* Thinking, memory, language, and problem-solving.
|
214 |
+
* Using information from the senses to form mental representations.
|
215 |
+
|
216 |
+
**4. Emotional Function:**
|
217 |
+
* Regulating emotions and feelings.
|
218 |
+
* Processing and expressing emotions.
|
219 |
+
|
220 |
+
**5. Sensory-Motor Integration:**
|
221 |
+
* Coordinating sensory and motor functions to maintain balance and posture.
|
222 |
+
|
223 |
+
**Processes in the Brain:**
|
224 |
+
|
225 |
+
**1. Neurotransmission:**
|
226 |
+
* Electrical or chemical signals are sent across synapses.
|
227 |
+
* Neurotransmitters are chemicals that cross synaptic gaps to excite or inhibit neurons.
|
228 |
+
|
229 |
+
**2. Signal Processing:**
|
230 |
+
* Neurons receive and process signals from other neurons.
|
231 |
+
* They use this information to generate their own electrical or chemical signals.
|
232 |
+
|
233 |
+
**3. Learning and Memory:**
|
234 |
+
* The brain forms memories through repeated experiences.
|
235 |
+
* Memories are stored in the brain and can be used to guide behavior and decision-making.
|
236 |
+
|
237 |
+
**4. Adaptation:**
|
238 |
+
* The brain can adapt to new experiences and stimuli.
|
239 |
+
* This process is essential for learning and survival.
|
240 |
+
|
241 |
+
**5. Homeostasis:**
|
242 |
+
* The brain maintains the body's internal balance.
|
243 |
+
* It regulates body temperature, blood sugar levels, and other vital functions.
|
244 |
+
|
245 |
+
**Factors Influencing Brain Function:**
|
246 |
+
|
247 |
+
* Genetics
|
248 |
+
* Environment
|
249 |
+
* Experience
|
250 |
+
* Sleep
|
251 |
+
* Nutrition
|
252 |
+
* Stress
|
253 |
+
|
254 |
+
**Conclusion:**
|
255 |
+
|
256 |
+
The brain is a remarkable organ that allows humans to experience the world, think, and move. Understanding how the brain works is essential for understanding human health and disease.<end_of_turn>
|
257 |
+
<start_of_turn>user
|
258 |
+
What influence does sleep have on the brain?<end_of_turn>
|
259 |
+
<start_of_turn>model
|
260 |
+
**Sleep exerts a profound influence on the brain, playing a crucial role in various cognitive, physiological, and emotional processes.**
|
261 |
+
|
262 |
+
**Cognitive effects:**
|
263 |
+
|
264 |
+
* Enhanced memory consolidation and retention
|
265 |
+
* Improved attention and focus
|
266 |
+
* Increased creativity and innovation
|
267 |
+
* Reduced risk of cognitive decline and dementia
|
268 |
+
|
269 |
+
**Physiological effects:**
|
270 |
+
|
271 |
+
* Restoration of cellular and synaptic plasticity
|
272 |
+
* Regulation of neurotransmitter activity
|
273 |
+
* Increased production of growth hormone and other hormones
|
274 |
+
* Reduced inflammation and oxidative stress
|
275 |
+
|
276 |
+
**Emotional effects:**
|
277 |
+
|
278 |
+
* Reduced emotional reactivity and stress levels
|
279 |
+
* Improved mood and emotional regulation
|
280 |
+
* Increased resilience to stress
|
281 |
+
* Enhanced empathy and social connection
|
282 |
+
|
283 |
+
**Neurobiological mechanisms:**
|
284 |
+
|
285 |
+
* **Memory consolidation:** Sleep promotes the consolidation of memories through the formation of new synaptic connections.
|
286 |
+
* **Neurotransmitter regulation:** Sleep helps regulate the levels of various neurotransmitters, including dopamine, serotonin, and glutamate.
|
287 |
+
* **Cellular repair and growth:** Sleep promotes the repair and growth of neurons and other brain cells.
|
288 |
+
* **Synaptic plasticity:** Sleep is essential for the formation and strengthening of new synapses, which is crucial for learning and memory.
|
289 |
+
|
290 |
+
**Specific functions of sleep:**
|
291 |
+
|
292 |
+
* **Rapid eye movement (REM) sleep:** Associated with dreaming and emotional processing.
|
293 |
+
* **Slow-wave sleep:** Involved in restorative processes, such as tissue repair and hormone production.
|
294 |
+
* **Deep sleep:** Essential for memory consolidation and emotional regulation.
|
295 |
+
|
296 |
+
**Benefits of adequate sleep:**
|
297 |
+
|
298 |
+
* Improved cognitive function and academic performance
|
299 |
+
* Reduced risk of chronic diseases
|
300 |
+
* Increased resilience to stress
|
301 |
+
* Enhanced mood and emotional well-being
|
302 |
+
* Improved physical health
|
303 |
+
|
304 |
+
**Consequences of poor sleep:**
|
305 |
+
|
306 |
+
* Difficulty concentrating and remembering information
|
307 |
+
* Increased risk of accidents and errors
|
308 |
+
* Emotional instability and irritability
|
309 |
+
* Cognitive decline and dementia<end_of_turn>
|
310 |
+
```
|
311 |
+
|
312 |
+
## Technical Details
|
313 |
+
|
314 |
+
Gemma 1.1 2B instruct is tuned using a novel Reinforced Learning through Human Feedback (RLHF) approach, leading to its noted gains over the first release.
|
315 |
+
|
316 |
+
Gemma also has an extremely large vocabulary, which tends to help with multilingual and coding proficiency.
|
317 |
+
|
318 |
+
Gemma was trained on a wide dataset of 6 trillion tokens, including:
|
319 |
+
|
320 |
+
- Web Documents: A diverse collection of web text ensures the model is exposed to a broad range of linguistic styles, topics, and vocabulary. Primarily English-language content.
|
321 |
+
- Code: Exposing the model to code helps it to learn the syntax and patterns of programming languages, which improves its ability to generate code or understand code-related questions.
|
322 |
+
- Mathematics: Training on mathematical text helps the model learn logical reasoning, symbolic representation, and to address mathematical queries.
|
323 |
+
|
324 |
+
## Special thanks
|
325 |
+
|
326 |
+
🙏 Special thanks to [Georgi Gerganov](https://github.com/ggerganov) and the whole team working on [llama.cpp](https://github.com/ggerganov/llama.cpp/) for making all of this possible.
|
327 |
+
|
328 |
+
## Disclaimers
|
329 |
+
|
330 |
+
LM Studio is not the creator, originator, or owner of any Model featured in the Community Model Program. Each Community Model is created and provided by third parties. LM Studio does not endorse, support, represent or guarantee the completeness, truthfulness, accuracy, or reliability of any Community Model. You understand that Community Models can produce content that might be offensive, harmful, inaccurate or otherwise inappropriate, or deceptive. Each Community Model is the sole responsibility of the person or entity who originated such Model. LM Studio may not monitor or control the Community Models and cannot, and does not, take responsibility for any such Model. LM Studio disclaims all warranties or guarantees about the accuracy, reliability or benefits of the Community Models. LM Studio further disclaims any warranty that the Community Model will meet your requirements, be secure, uninterrupted or available at any time or location, or error-free, viruses-free, or that any errors will be corrected, or otherwise. You will be solely responsible for any damage resulting from your use of or access to the Community Models, your downloading of any Community Model, or use of any other Community Model provided by or through LM Studio.
|