bol20162021 commited on
Commit
216215c
1 Parent(s): ee261dd

Create README.md

Browse files
Files changed (1) hide show
  1. README.md +57 -0
README.md ADDED
@@ -0,0 +1,57 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: llama2
3
+ inference:
4
+ parameters:
5
+ do_sample: false
6
+ max_length: 200
7
+ widget:
8
+ - text: "CREATE TABLE stadium (\n stadium_id number,\n location text,\n name text,\n capacity number,\n)\n\n-- Using valid SQLite, answer the following questions for the tables provided above.\n\n-- how many stadiums in total?\n\nSELECT"
9
+ example_title: "Number stadiums"
10
+ - text: "CREATE TABLE work_orders ( ID NUMBER, CREATED_AT TEXT, COST FLOAT, INVOICE_AMOUNT FLOAT, IS_DUE BOOLEAN, IS_OPEN BOOLEAN, IS_OVERDUE BOOLEAN, COUNTRY_NAME TEXT, )\n\n-- Using valid SQLite, answer the following questions for the tables provided above.\n\n-- how many work orders are open?\n\nSELECT"
11
+ example_title: "Open work orders"
12
+ - text: "CREATE TABLE stadium ( stadium_id number, location text, name text, capacity number, highest number, lowest number, average number )\n\nCREATE TABLE singer ( singer_id number, name text, country text, song_name text, song_release_year text, age number, is_male others )\n\nCREATE TABLE concert ( concert_id number, concert_name text, theme text, stadium_id text, year text )\n\nCREATE TABLE singer_in_concert ( concert_id number, singer_id text )\n\n-- Using valid SQLite, answer the following questions for the tables provided above.\n\n-- What is the maximum, the average, and the minimum capacity of stadiums ?\n\nSELECT"
13
+ example_title: "Stadium capacity"
14
+ ---
15
+
16
+ # NSQL-Llama-2-70B
17
+
18
+ ## Model Description
19
+
20
+ NSQL is a family of autoregressive open-source large foundation models (FMs) designed specifically for SQL generation tasks.
21
+
22
+ In this repository we are introducing a new member of NSQL, NSQL-Llama-2-70B. It's based on Meta's original [Llama-2 70B model](https://huggingface.co/meta-llama/Llama-2-70b) and further pre-trained on a dataset of general SQL queries and then fine-tuned on a dataset composed of text-to-SQL pairs.
23
+
24
+ ### Basic Information
25
+
26
+ <!-- Provide the basic links for the model. -->
27
+ - **Blog Post**: [Link](TBA)
28
+ - **Discord**: [Link](TBA)
29
+ - **HF Hosting**: [Chat with me!](TBA)
30
+
31
+ ## Training Data
32
+
33
+ The general SQL queries are the SQL subset from [The Stack](https://huggingface.co/datasets/bigcode/the-stack), containing 1M training samples. The labeled text-to-SQL pairs come from the NSText2SQL dataset (https://huggingface.co/datasets/NumbersStation/NSText2SQL).
34
+
35
+ ## Evaluation Data
36
+
37
+ We evaluate our models on three text-to-SQL benchmarks: Spider, Bird, and text2sql.
38
+
39
+ ## Training Procedure
40
+
41
+ NSQL was trained using cross-entropy loss to maximize the likelihood of sequential inputs. For finetuning on text-to-SQL pairs, we only compute the loss over the SQL portion of the pair. The model is trained using SambaNova's in-house Reconfigurable Dataflow Unit (RDU), leveraging data and model parallelism. We pre-trained for 2 epochs and fine-tuned for 10 epochs.
42
+
43
+ ## Intended Use and Limitations
44
+
45
+ The model was designed for text-to-SQL generation tasks from given table schema and natural language prompts. The model works best with the prompt format defined below and outputting `SELECT` queries.
46
+
47
+ ## How to Use
48
+
49
+ Example 1:
50
+
51
+ ```python
52
+ import torch
53
+ from transformers import AutoTokenizer, AutoModelForCausalLM
54
+ tokenizer = AutoTokenizer.from_pretrained("sambanovasystems/nsql-Llama-2-70B")
55
+ model = AutoModelForCausalLM.from_pretrained("sambanovasystems/nsql-Llama-2-70B", torch_dtype=torch.bfloat16)
56
+
57
+ ```