Update README.md
Browse files
README.md
CHANGED
@@ -1,3 +1,68 @@
|
|
1 |
-
---
|
2 |
-
|
3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
base_model: onekq-ai/OneSQL-v0.2-Qwen-1.5B
|
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-1.5B](https://huggingface.co/onekq-ai/OneSQL-v0.2-Qwen-1.5B).
|
19 |
+
|
20 |
+
# Performances
|
21 |
+
|
22 |
+
Below is the self-evaluation results for each quantization and its improvement over [OneSQL-v0.1-Qwen-1.5B-GGUF](https://huggingface.co/onekq-ai/OneSQL-v0.1-Qwen-1.5B-GGUF).
|
23 |
+
|
24 |
+
| Quantization |EX score|v0.1 EX score
|
25 |
+
|--------------|--------|-------|
|
26 |
+
| Q2_K | 7.76 | 2.50 |
|
27 |
+
| Q3_K_S | 9.13 | 9.85 |
|
28 |
+
| Q3_K_M | 17.41 | 11.80 |
|
29 |
+
| Q3_K_L | 16.69 | 11.80 |
|
30 |
+
| Q4_0 | 18.77 | 13.77 |
|
31 |
+
| Q4_1 | 22.69 | 12.74 |
|
32 |
+
| Q4_K_S | **24.33** | 13.32 |
|
33 |
+
| Q4_K_M | 22.64 | 12.39 |
|
34 |
+
| Q5_0 | 22.23 | 13.95 |
|
35 |
+
| Q5_1 | 22.69 | 13.05 |
|
36 |
+
| Q5_K_S | 23.27 | **14.36** |
|
37 |
+
| Q5_K_M | 23.92 | 14.10 |
|
38 |
+
| Q6_K | 23.72 | 13.95 |
|
39 |
+
| Q8_0 | 23.79 | 13.24 |
|
40 |
+
# Quick start
|
41 |
+
|
42 |
+
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 **--**.
|
43 |
+
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.
|
44 |
+
|
45 |
+
```sh
|
46 |
+
PROMPT="CREATE TABLE students (
|
47 |
+
id INTEGER PRIMARY KEY,
|
48 |
+
name TEXT,
|
49 |
+
age INTEGER,
|
50 |
+
grade TEXT
|
51 |
+
);
|
52 |
+
|
53 |
+
-- Find the three youngest students
|
54 |
+
SELECT "
|
55 |
+
|
56 |
+
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")
|
57 |
+
|
58 |
+
llama.cpp/build/bin/llama-run file://OneSQL-v0.2-Qwen-1.5B-Q4_K_M.gguf "$PROMPT"
|
59 |
+
```
|
60 |
+
|
61 |
+
The model response is the finished SQL query without **SELECT**
|
62 |
+
```sql
|
63 |
+
* FROM students ORDER BY age ASC LIMIT 3
|
64 |
+
```
|
65 |
+
|
66 |
+
# Caveats
|
67 |
+
|
68 |
+
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.
|