Views
No views yet

| model | easy | medium | hard | extra |
|---|---|---|---|---|
| sqlcoder-7b-2 | 72.0 | 58.0 | 40.6 | 37.3 |
| pipSQL-1.3b | 78.5 | 57.5 | 42.1 | 28.3 |
| pipSQL-7b | 63.0 | 40.0 | 30.2 | 25.0 |
| sqlcoder-7b | 60.6 | 48.2 | 28.3 | 20.4 |
| gpt-3.5 | 58.8 | 44.7 | 31.0 | 28.4 |

pip install transformers1prompt = f"""<schema>{schema}</schema>
2<question>{question}</question>
3<sql>"""1from transformers import AutoModelForCausalLM, AutoTokenizer
2device = "cuda"
3model = AutoModelForCausalLM.from_pretrained("PipableAI/pip-sql-1.3b")
4tokenizer = AutoTokenizer.from_pretrained("PipableAI/pip-sql-1.3b")
5
6inputs = tokenizer(text, return_tensors="pt")
7outputs = model.generate(**inputs, max_new_tokens=200)
8print(tokenizer.decode(outputs[0], skip_special_tokens=True).split('<sql>')[1].split('</sql>')[0])1from transformers import FlaxAutoModelForCausalLM, AutoTokenizer
2device = "cuda"
3model = FlaxAutoModelForCausalLM.from_pretrained("PipableAI/pip-sql-1.3b",from_pt=True)
4tokenizer = AutoTokenizer.from_pretrained("PipableAI/pip-sql-1.3b")
5
6inputs = tokenizer(text, return_tensors="jax")
7outputs = model.generate(**inputs, max_new_tokens=200)
8print(tokenizer.decode(outputs[0], skip_special_tokens=True).split('<sql>')[1].split('</sql>')[0])1CREATE TABLE Products (
2 product_id number,
3 parent_product_id number,
4 product_name text,
5 product_price number,
6 product_color text,
7 product_size text,
8 product_description text);
9
10CREATE TABLE Customers (
11 customer_id number,
12 gender_code text,
13 customer_first_name text,
14 customer_middle_initial text,
15 customer_last_name text,
16 email_address text,
17 login_name text,
18 login_password text,
19 phone_number text,
20 address_line_1 text,
21 town_city text,
22 county text,
23 country text);
24
25CREATE TABLE Customer_Payment_Methods (
26 customer_id number,
27 payment_method_code text);
28
29CREATE TABLE Invoices (
30 invoice_number number,
31 invoice_status_code text,
32 invoice_date time);
33
34CREATE TABLE Orders (
35 order_id number,
36 customer_id number,
37 order_status_code text,
38 date_order_placed time);
39
40CREATE TABLE Order_Items (
41 order_item_id number,
42 product_id number,
43 order_id number,
44 order_item_status_code text);
45
46CREATE TABLE Shipments (
47 shipment_id number,
48 order_id number,
49 invoice_number number,
50 shipment_tracking_number text,
51 shipment_date time);
52
53CREATE TABLE Shipment_Items (
54 shipment_id number,
55 order_item_id number);SELECT email_address , town_city , county FROM customers GROUP BY gender_code ORDER BY count(*) ASC LIMIT 1SELECT product_price , product_size FROM products WHERE product_price > (SELECT avg(product_price) FROM products)SELECT T1.customer_first_name , T1.customer_middle_initial , T1.customer_last_name FROM Customers AS T1 WHERE T1.customer_id NOT IN (SELECT T2.customer_id FROM Orders AS T2)