bartowski commited on
Commit
70c58c7
1 Parent(s): eaab160

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +172 -28
README.md CHANGED
@@ -73,33 +73,177 @@ model-index:
73
  verified: false
74
  quantized_by: bartowski
75
  pipeline_tag: text-generation
 
 
 
 
 
 
 
 
76
  ---
77
 
78
- ## Llamacpp Quantizations of stable-code-instruct-3b
79
-
80
- Using <a href="https://github.com/ggerganov/llama.cpp/">llama.cpp</a> release <a href="https://github.com/ggerganov/llama.cpp/releases/tag/b2440">b2440</a> for quantization.
81
-
82
- Original model: https://huggingface.co/stabilityai/stable-code-instruct-3b
83
-
84
- Download a file (not the whole branch) from below:
85
-
86
- | Filename | Quant type | File Size | Description |
87
- | -------- | ---------- | --------- | ----------- |
88
- | [stable-code-instruct-3b-Q8_0.gguf](https://huggingface.co/bartowski/stable-code-instruct-3b-GGUF/blob/main/stable-code-instruct-3b-Q8_0.gguf) | Q8_0 | 2.97GB | Extremely high quality, generally unneeded but max available quant. |
89
- | [stable-code-instruct-3b-Q6_K.gguf](https://huggingface.co/bartowski/stable-code-instruct-3b-GGUF/blob/main/stable-code-instruct-3b-Q6_K.gguf) | Q6_K | 2.29GB | Very high quality, near perfect, *recommended*. |
90
- | [stable-code-instruct-3b-Q5_K_M.gguf](https://huggingface.co/bartowski/stable-code-instruct-3b-GGUF/blob/main/stable-code-instruct-3b-Q5_K_M.gguf) | Q5_K_M | 1.99GB | High quality, very usable. |
91
- | [stable-code-instruct-3b-Q5_K_S.gguf](https://huggingface.co/bartowski/stable-code-instruct-3b-GGUF/blob/main/stable-code-instruct-3b-Q5_K_S.gguf) | Q5_K_S | 1.94GB | High quality, very usable. |
92
- | [stable-code-instruct-3b-Q5_0.gguf](https://huggingface.co/bartowski/stable-code-instruct-3b-GGUF/blob/main/stable-code-instruct-3b-Q5_0.gguf) | Q5_0 | 1.94GB | High quality, older format, generally not recommended. |
93
- | [stable-code-instruct-3b-Q4_K_M.gguf](https://huggingface.co/bartowski/stable-code-instruct-3b-GGUF/blob/main/stable-code-instruct-3b-Q4_K_M.gguf) | Q4_K_M | 1.70GB | Good quality, similar to 4.25 bpw. |
94
- | [stable-code-instruct-3b-Q4_K_S.gguf](https://huggingface.co/bartowski/stable-code-instruct-3b-GGUF/blob/main/stable-code-instruct-3b-Q4_K_S.gguf) | Q4_K_S | 1.62GB | Slightly lower quality with small space savings. |
95
- | [stable-code-instruct-3b-IQ4_NL.gguf](https://huggingface.co/bartowski/stable-code-instruct-3b-GGUF/blob/main/stable-code-instruct-3b-IQ4_NL.gguf) | IQ4_NL | 1.61GB | Good quality, similar to Q4_K_S, new method of quanting, |
96
- | [stable-code-instruct-3b-IQ4_XS.gguf](https://huggingface.co/bartowski/stable-code-instruct-3b-GGUF/blob/main/stable-code-instruct-3b-IQ4_XS.gguf) | IQ4_XS | 1.53GB | Decent quality, new method with similar performance to Q4. |
97
- | [stable-code-instruct-3b-Q4_0.gguf](https://huggingface.co/bartowski/stable-code-instruct-3b-GGUF/blob/main/stable-code-instruct-3b-Q4_0.gguf) | Q4_0 | 1.60GB | Decent quality, older format, generally not recommended. |
98
- | [stable-code-instruct-3b-IQ3_M.gguf](https://huggingface.co/bartowski/stable-code-instruct-3b-GGUF/blob/main/stable-code-instruct-3b-IQ3_M.gguf) | IQ3_M | 1.31GB | Medium-low quality, new method with decent performance. |
99
- | [stable-code-instruct-3b-IQ3_S.gguf](https://huggingface.co/bartowski/stable-code-instruct-3b-GGUF/blob/main/stable-code-instruct-3b-IQ3_S.gguf) | IQ3_S | 1.25GB | Lower quality, new method with decent performance, recommended over Q3 quants. |
100
- | [stable-code-instruct-3b-Q3_K_L.gguf](https://huggingface.co/bartowski/stable-code-instruct-3b-GGUF/blob/main/stable-code-instruct-3b-Q3_K_L.gguf) | Q3_K_L | 1.50GB | Lower quality but usable, good for low RAM availability. |
101
- | [stable-code-instruct-3b-Q3_K_M.gguf](https://huggingface.co/bartowski/stable-code-instruct-3b-GGUF/blob/main/stable-code-instruct-3b-Q3_K_M.gguf) | Q3_K_M | 1.39GB | Even lower quality. |
102
- | [stable-code-instruct-3b-Q3_K_S.gguf](https://huggingface.co/bartowski/stable-code-instruct-3b-GGUF/blob/main/stable-code-instruct-3b-Q3_K_S.gguf) | Q3_K_S | 1.25GB | Low quality, not recommended. |
103
- | [stable-code-instruct-3b-Q2_K.gguf](https://huggingface.co/bartowski/stable-code-instruct-3b-GGUF/blob/main/stable-code-instruct-3b-Q2_K.gguf) | Q2_K | 1.08GB | Extremely low quality, *not* recommended.
104
-
105
- Want to support my work? Visit my ko-fi page here: https://ko-fi.com/bartowski
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
73
  verified: false
74
  quantized_by: bartowski
75
  pipeline_tag: text-generation
76
+ lm_studio:
77
+ param_count: 3b
78
+ use_case: coding
79
+ release_date: 19-03-2024
80
+ model_creator: stabilityai
81
+ prompt_template: ChatML
82
+ base_model: stablelm
83
+ original_repo: stabilityai/stable-code-instruct-3b
84
  ---
85
 
86
+ ## 💫 Community Model> Stable Code Instruct 3B Stability AI
87
+
88
+ *👾 [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)*.
89
+
90
+ **Model creator:** [Stability AI](https://huggingface.co/stabilityai)<br>
91
+ **Original model**: [stable-code-instruct-3b](https://huggingface.co/stabilityai/stable-code-instruct-3b)<br>
92
+ **GGUF quantization:** provided by [bartowski](https://huggingface.co/bartowski) based on `llama.cpp` release [b2440](https://github.com/ggerganov/llama.cpp/releases/tag/b2440)<br>
93
+
94
+ ## Model Summary:
95
+ Stable Code Instruct 3B is part of the Stable Code family, instruction tuned using [Direct Preference Optimization (DPO)](https://arxiv.org/abs/2305.18290) from the base Stable Code 3B model.
96
+ This model is great for general purpose coversational coding, as well as SQL generation.<br>
97
+
98
+ ## Prompt Template:
99
+
100
+ Choose the `ChatML` preset in your LM Studio.
101
+
102
+ Under the hood, the model will see a prompt that's formatted like so:
103
+ ```
104
+ <|im_start|>system
105
+ A chat between a curious user and an artificial intelligence assistant. The assistant gives helpful, detailed, and polite answers to the user's questions.<|im_end|>
106
+ <|im_start|>user
107
+ {prompt}<|im_end|>
108
+ <|im_start|>assistant
109
+ ```
110
+
111
+ ## Use case and examples
112
+
113
+ Stable Code Instruct 3B is trained primarily on coding, with a bit of conversational tuning to provide some assistant behavior. It also excels at SQL generation. This makes it great for light-weight coding purposes and its size makes it extremely fast for potential code-completion.
114
+
115
+ ### SQL generation with explanation:
116
+
117
+ <|im_start|>system<br>
118
+ A chat between a curious user and an artificial intelligence assistant. The assistant gives helpful, detailed, and polite answers to the user's questions.<|im_end|><br>
119
+ <|im_start|>user<br>
120
+ Using python, how can I create an SQL table where the primary key is a combination of two columns?<|im_end|><br>
121
+ <|im_start|>assistant<br>
122
+ To create an SQL table with a composite primary key in Python, you can use the `sqlite3` module. Here's an example code snippet:
123
+ ```python
124
+ import sqlite3
125
+ # Connect to the database (or create it if it doesn't exist)
126
+ conn = sqlite3.connect('example.db')
127
+ # Create a cursor object to execute SQL commands
128
+ c = conn.cursor()
129
+ # Define the table schema with a composite primary key
130
+ schema = '''
131
+ CREATE TABLE example_table (
132
+ column1 TEXT,
133
+ column2 INTEGER,
134
+ PRIMARY KEY (column1, column2)
135
+ );
136
+ '''
137
+ # Execute the SQL command to create the table
138
+ c.execute(schema)
139
+ # Commit the changes to the database
140
+ conn.commit()
141
+ # Close the database connection
142
+ conn.close()
143
+ ```
144
+ In this example, we first import the `sqlite3` module and create a connection to the database (or create it if it doesn't exist). We then create a cursor object to execute SQL commands.
145
+ Next, we define the table schema with a composite primary key using the `CREATE TABLE` command. In this example, the table is named `example_table` and has two columns: `column1` (text data type) and `column2` (integer data type). The `PRIMARY KEY` constraint is used to specify that the combination of `column1` and `column2` should be unique for each row in the table.
146
+ After defining the table schema, we execute the SQL command using the cursor object. We then commit the changes to the database and close the database connection.
147
+ Note that this example assumes that you have already installed the `sqlite3` module in your Python environment. If you haven't done so already, you can install it by running the following command in your terminal or command prompt:
148
+ ```
149
+ pip install sqlite3
150
+ ```
151
+ This will install the `sqlite3` module in your Python environment.<|im_end|>
152
+
153
+
154
+ ### General python coding questions:
155
+
156
+ <|im_start|>system<br>
157
+ A chat between a curious user and an artificial intelligence assistant. The assistant gives helpful, detailed, and polite answers to the user's questions.<|im_end|><br>
158
+ <|im_start|>user<br>
159
+ Using python, how can I create an SQL table where the primary key is a combination of two columns?<|im_end|><br>
160
+ <|im_start|>assistant<br>
161
+ You can achieve this by using Python's built-in `sort()` function or `sorted()` function. Both these functions allow you to specify multiple sorting conditions.
162
+
163
+ Here is an example code snippet that demonstrates how to sort a list of integer tuples based on the second item, then the first:
164
+ ```python
165
+ # Sample list of integer tuples
166
+ my_list = [(1, 2), (3, 1), (2, 3)]
167
+
168
+ # Sort the list by the second item, then the first
169
+ my_list.sort(key=lambda x: (x[1], x[0]))))
170
+
171
+ # Print the sorted list
172
+ print(my_list)
173
+ ```
174
+ In this example, we use a lambda function as the `key` argument to the `sort()` function. The lambda function takes each tuple in the list and returns a tuple of the second item and the first item of the original tuple. This way, the tuples are sorted based on the second item first, then by the first item if there is a tie.
175
+
176
+ The output of this code will be:
177
+ ```
178
+ [(3, 1), (1, 2), (2, 3)]
179
+ ```
180
+ This means that the list has been sorted in ascending order based on the second item of each tuple, and if there is a tie, it is resolved by sorting based on the first item of each tuple.
181
+
182
+ ### General C coding questions:
183
+
184
+ <|im_start|>system<br>
185
+ A chat between a curious user and an artificial intelligence assistant. The assistant gives helpful, detailed, and polite answers to the user's questions.<|im_end|><br>
186
+ <|im_start|>user<br>
187
+ <|im_start|>user
188
+ Can you write a C program that takes two numbers and prints their sum to the console?<|im_end|>
189
+ <|im_start|>assistant
190
+ Sure! Here is a simple C program that does exactly what you asked for:
191
+
192
+ ```c
193
+ #include <stdio.h>
194
+
195
+ int main() {
196
+ int num1, num2, sum;
197
+
198
+ printf("Enter first number: ");
199
+ scanf("%d", &num1);
200
+
201
+ printf("Enter second number: ");
202
+ scanf("%d", &num2);
203
+
204
+ sum = num1 + num2;
205
+
206
+ printf("The sum of %d and %d is %d\n", num1, num2, sum);
207
+
208
+ return 0;
209
+ }
210
+ ```
211
+
212
+ This program first prompts the user to enter two numbers. It then calculates the sum of those two numbers and prints the result to the console.
213
+
214
+ ## Technical Details
215
+
216
+ The base model was trained from the following datasets:
217
+
218
+ - [tiiuae/falcon-refinedweb](https://huggingface.co/datasets/tiiuae/falcon-refinedweb)
219
+ - [bigcode/the-stack-github-issues](https://huggingface.co/datasets/bigcode/the-stack-github-issues)
220
+ - [bigcode/commitpackft](https://huggingface.co/datasets/bigcode/commitpackft)
221
+ - [bigcode/starcoderdata](https://huggingface.co/datasets/bigcode/starcoderdata)
222
+ - [EleutherAI/proof-pile-2](https://huggingface.co/datasets/EleutherAI/proof-pile-2)
223
+ - [meta-math/MetaMathQA](https://huggingface.co/datasets/meta-math/MetaMathQA)
224
+
225
+ Specializing in the following languages:
226
+ - C
227
+ - CPP
228
+ - Java
229
+ - JavaScript
230
+ - CSS
231
+ - Go
232
+ - HTML
233
+ - Ruby
234
+ - Rust
235
+ - Markdown
236
+ - Shell
237
+ - Php
238
+ - Sql
239
+ - R
240
+ - Typescript
241
+ - Python
242
+ - Jupyter-Clean
243
+ - RestructuredText
244
+
245
+ 🙏 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.
246
+
247
+ ## Disclaimers
248
+
249
+ TBD