Create README.md
Browse files
README.md
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
base_model: onekq-ai/OneSQL-v0.1-Qwen-7B
|
| 3 |
+
tags:
|
| 4 |
+
- text-generation-inference
|
| 5 |
+
- transformers
|
| 6 |
+
- qwen2
|
| 7 |
+
- awq
|
| 8 |
+
license: apache-2.0
|
| 9 |
+
language:
|
| 10 |
+
- en
|
| 11 |
+
---
|
| 12 |
+
|
| 13 |
+
# Introduction
|
| 14 |
+
|
| 15 |
+
This model is the AWQ version of [OneSQL-v0.1-Qwen-7B](https://huggingface.co/onekq-ai/OneSQL-v0.1-Qwen-7B).
|
| 16 |
+
|
| 17 |
+
# Performances
|
| 18 |
+
|
| 19 |
+
The self-evaluation EX score of the original model is **56.19** (compared to **63.33** by the 32B model on the [BIRD leaderboard](https://bird-bench.github.io/).
|
| 20 |
+
The self-evaluation score of this AWQ model is **43.54%**.
|
| 21 |
+
|
| 22 |
+
# Quick start
|
| 23 |
+
|
| 24 |
+
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 **--**.
|
| 25 |
+
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.
|
| 26 |
+
|
| 27 |
+
```python
|
| 28 |
+
from vllm import LLM, SamplingParams
|
| 29 |
+
|
| 30 |
+
llm = LLM(model="onekq-ai/OneSQL-v0.1-Qwen-7B-AWQ")
|
| 31 |
+
sampling_params = SamplingParams(temperature=0.7, max_tokens=200)
|
| 32 |
+
|
| 33 |
+
prompt="CREATE TABLE students (
|
| 34 |
+
id INTEGER PRIMARY KEY,
|
| 35 |
+
name TEXT,
|
| 36 |
+
age INTEGER,
|
| 37 |
+
grade TEXT
|
| 38 |
+
);
|
| 39 |
+
|
| 40 |
+
-- Find the three youngest students
|
| 41 |
+
SELECT "
|
| 42 |
+
|
| 43 |
+
outputs = llm.generate(prompt, sampling_params)
|
| 44 |
+
print(outputs[0].outputs[0].text.strip())
|
| 45 |
+
```
|
| 46 |
+
|
| 47 |
+
The model response is the finished SQL query without **SELECT**
|
| 48 |
+
```sql
|
| 49 |
+
* FROM students ORDER BY age ASC LIMIT 3
|
| 50 |
+
```
|
| 51 |
+
|
| 52 |
+
# Caveats
|
| 53 |
+
|
| 54 |
+
The performance drop from the original model is due to quantization itself, and the lack of beam search support in the vLLM framework. Use at your own discretion.
|