Update README.md
Browse files
README.md
CHANGED
@@ -1,3 +1,66 @@
|
|
1 |
-
---
|
2 |
-
|
3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
base_model: onekq-ai/OneSQL-v0.2-Qwen-3B
|
3 |
+
tags:
|
4 |
+
- text-generation-inference
|
5 |
+
- transformers
|
6 |
+
- qwen2
|
7 |
+
- gguf
|
8 |
+
license: apache-2.0
|
9 |
+
language:
|
10 |
+
- en
|
11 |
+
---
|
12 |
+
|
13 |
+
# Disclaimer
|
14 |
+
Your email will be used for anonymous survey. It will not be shared with anyone.
|
15 |
+
|
16 |
+
# Introduction
|
17 |
+
|
18 |
+
This model is the GGUF version of [OneSQL-v0.2-Qwen-3B](https://huggingface.co/onekq-ai/OneSQL-v0.2-Qwen-3B).
|
19 |
+
|
20 |
+
# Performances
|
21 |
+
|
22 |
+
Below is the self-evaluation results for each quantization and improvement to [OneSQL-v0.1-Qwen-3B-GGUF](https://huggingface.co/onekq-ai/OneSQL-v0.1-Qwen-3B-GGUF).
|
23 |
+
|
24 |
+
| Quantization |EX score|v0.1 EX score
|
25 |
+
|------------|-------|-------|
|
26 |
+
| Q4_0 | 29.59 | 16.83 |
|
27 |
+
| Q4_1 | 32.35 | 21.85 |
|
28 |
+
| Q4_K_S | 31.16 | 22.49 |
|
29 |
+
| Q4_K_M | 31.03 | 21.85 |
|
30 |
+
| Q5_0 | 31.24 | 23.40 |
|
31 |
+
| Q5_1 | 33.27 | 23.53 |
|
32 |
+
| Q5_K_S | | 22.77 |
|
33 |
+
| Q5_K_M | | 23.73 |
|
34 |
+
| Q6_K | | 24.51 |
|
35 |
+
| **Q8_0** | | **24.90** |
|
36 |
+
|
37 |
+
# Quick start
|
38 |
+
|
39 |
+
To use this model, craft your prompt to start with your database schema in the form of **CREATE TABLE**, followed by your natural language query preceded by **--**.
|
40 |
+
Make sure your prompt ends with **SELECT** in order for the model to finish the query for you. There is no need to set other parameters like temperature or max token limit.
|
41 |
+
|
42 |
+
```sh
|
43 |
+
PROMPT="CREATE TABLE students (
|
44 |
+
id INTEGER PRIMARY KEY,
|
45 |
+
name TEXT,
|
46 |
+
age INTEGER,
|
47 |
+
grade TEXT
|
48 |
+
);
|
49 |
+
|
50 |
+
-- Find the three youngest students
|
51 |
+
SELECT "
|
52 |
+
|
53 |
+
PROMPT=$(printf "<|im_start|>system\nYou are a SQL expert. Return code only.<|im_end|>\n<|im_start|>user\n%s<|im_end|>\n<|im_start|>assistant\n" "$PROMPT")
|
54 |
+
|
55 |
+
llama.cpp/build/bin/llama-run file://OneSQL-v0.2-Qwen-1.5B-Q4_K_M.gguf "$PROMPT"
|
56 |
+
```
|
57 |
+
|
58 |
+
The model response is the finished SQL query without **SELECT**
|
59 |
+
```sql
|
60 |
+
* FROM students ORDER BY age ASC LIMIT 3
|
61 |
+
```
|
62 |
+
|
63 |
+
# Caveats
|
64 |
+
|
65 |
+
* The performance drop from the original model is due to quantization itself, and the lack of beam search support in llama.cpp framework. Use at your own discretion.
|
66 |
+
* The 2-bit and 3-bit quantizations suffer from repetitive and unrelevant output token, hence are not recommended for usage.
|