This model is the AWQ version of
OneSQL-v0.1-Qwen-7B.
The self-evaluation EX score of the original model is
56.19 (compared to
63.33 by the 32B model on the
BIRD leaderboard.
The self-evaluation EX score of this AWQ model is
47.84.
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 --.
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.
1from vllm import LLM, SamplingParams
2
3llm = LLM(model="onekq-ai/OneSQL-v0.1-Qwen-7B-AWQ")
4sampling_params = SamplingParams(temperature=0.7, max_tokens=200)
5
6prompt="CREATE TABLE students (
7 id INTEGER PRIMARY KEY,
8 name TEXT,
9 age INTEGER,
10 grade TEXT
11);
12
13-- Find the three youngest students
14SELECT "
15
16outputs = llm.generate(f"<|im_start|>system\nYou are a SQL expert. Return code only.<|im_end|>\n<|im_start|>user\n{prompt}<|im_end|>\n<|im_start|>assistant\n", sampling_params)
17print(outputs[0].outputs[0].text.strip())
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.