defog / sqlcoder-7b

huggingface.co
Total runs: 150
24-hour runs: 3
7-day runs: -8
30-day runs: 27
Model's Last Updated: February 06 2024
text-generation

Introduction of sqlcoder-7b

Model Details of sqlcoder-7b

IMPORTANT

This model is now outdated. Please use defog/sqlcoder-7b-2 for much better performance!

Defog SQLCoder

Defog's SQLCoder is a state-of-the-art LLM for converting natural language questions to SQL queries.

Interactive Demo | 🤗 HF Repo | ♾️ Colab | 🐦 Twitter

TL;DR

SQLCoder-7B is a 7B parameter model that outperforms gpt-3.5-turbo for natural language to SQL generation tasks on our sql-eval framework, and significantly outperforms all popular open-source models. When fine-tuned on a given schema, it also outperforms gpt-4

SQLCoder-7B is fine-tuned on a base Mistral-7B model.

Results on novel datasets not seen in training
model perc_correct
gpt4-2023-10-04 82.0
defog-sqlcoder2 74.5
gpt4-2023-08-28 74.0
defog-sqlcoder-7b 71.0
gpt-3.5-2023-10-04 66.0
claude-2 64.5
gpt-3.5-2023-08-28 61.0
claude_instant_1 61.0
text-davinci-003 52.5
License

The code in this repo (what little there is of it) is Apache-2 licensed. The model weights have a CC BY-SA 4.0 license. The TL;DR is that you can use and modify the model for any purpose – including commercial use. However, if you modify the weights (for example, by fine-tuning), you must open-source your modified weights under the same license terms.

Training

SQLCoder was trained on more than 20,000 human-curated questions. These questions were based on 10 different schemas. None of the schemas in the training data were included in our evaluation framework.

You can read more about our training approach and evaluation framework .

Results by question category

We classified each generated question into one of 5 categories. The table displays the percentage of questions answered correctly by each model, broken down by category.

query_category gpt-4 sqlcoder2-15b sqlcoder-7b gpt-3.5 claude-2 claude-instant gpt-3
date 72 76 64 68 52 48 32
group_by 91.4 80 82.9 77.1 71.4 71.4 71.4
order_by 82.9 77.1 74.3 68.6 74.3 74.3 68.6
ratio 80 60 54.3 37.1 57.1 45.7 25.7
join 82.9 77.1 74.3 71.4 65.7 62.9 57.1
where 80 77.1 74.3 74.3 62.9 60 54.3
Using SQLCoder

You can use SQLCoder via the transformers library by downloading our model weights from the Hugging Face repo. We have added sample code for inference on a sample database schema .

python inference.py -q "Question about the sample database goes here"

# Sample question:
# Do we get more revenue from customers in New York compared to customers in San Francisco? Give me the total revenue for each city, and the difference between the two.

You can also use a demo on our website here , or run SQLCoder in Colab here

Hardware Requirements

SQLCoder has been tested on an A100 40GB GPU with bfloat16 weights. You can also load an 8-bit and 4-bit quantized version of the model on consumer GPUs with 20GB or more of memory – like RTX 4090, RTX 3090, and Apple M2 Pro, M2 Max, or M2 Ultra Chips with 20GB or more of memory.

Todo
  • Open-source the v1 model weights
  • Train the model on more data, with higher data variance
  • Tune the model further with Reward Modelling and RLHF
  • Pretrain a model from scratch that specializes in SQL analysis

Runs of defog sqlcoder-7b on huggingface.co

150
Total runs
3
24-hour runs
2
3-day runs
-8
7-day runs
27
30-day runs

More Information About sqlcoder-7b huggingface.co Model

More sqlcoder-7b license Visit here:

https://choosealicense.com/licenses/cc-by-sa-4.0

sqlcoder-7b huggingface.co

sqlcoder-7b huggingface.co is an AI model on huggingface.co that provides sqlcoder-7b's model effect (), which can be used instantly with this defog sqlcoder-7b model. huggingface.co supports a free trial of the sqlcoder-7b model, and also provides paid use of the sqlcoder-7b. Support call sqlcoder-7b model through api, including Node.js, Python, http.

sqlcoder-7b huggingface.co Url

https://huggingface.co/defog/sqlcoder-7b

defog sqlcoder-7b online free

sqlcoder-7b huggingface.co is an online trial and call api platform, which integrates sqlcoder-7b's modeling effects, including api services, and provides a free online trial of sqlcoder-7b, you can try sqlcoder-7b online for free by clicking the link below.

defog sqlcoder-7b online free url in huggingface.co:

https://huggingface.co/defog/sqlcoder-7b

sqlcoder-7b install

sqlcoder-7b is an open source model from GitHub that offers a free installation service, and any user can find sqlcoder-7b on GitHub to install. At the same time, huggingface.co provides the effect of sqlcoder-7b install, users can directly use sqlcoder-7b installed effect in huggingface.co for debugging and trial. It also supports api for free installation.

sqlcoder-7b install url in huggingface.co:

https://huggingface.co/defog/sqlcoder-7b

Url of sqlcoder-7b

sqlcoder-7b huggingface.co Url

Provider of sqlcoder-7b huggingface.co

defog
ORGANIZATIONS

Other API from defog

huggingface.co

Total runs: 10.8K
Run Growth: -11.9K
Growth Rate: -110.52%
Updated:February 12 2024
huggingface.co

Total runs: 3.7K
Run Growth: -2.0K
Growth Rate: -55.09%
Updated:October 14 2023
huggingface.co

Total runs: 258
Run Growth: 25
Growth Rate: 9.69%
Updated:March 01 2024