Team Ai
Modelpublic

QuantFactory/sqlcoder-7b-2-GGUF

sourceHugging Facecc-by-sa-4.0updated 2y agoView on Hugging Face
2likes325downloads
Model Card

QuantFactory/sqlcoder-7b-2-GGUF

This is quantized version of defog/sqlcoder-7b-2 created using llama.cpp

Model Card for SQLCoder-7B-2

A capable large language model for natural language to SQL generation.

image/png

Model Details

Model Description

<!-- Provide a longer summary of what this model is. -->

This is the model card of a ๐Ÿค— transformers model that has been pushed on the Hub. This model card has been automatically generated.

  • โ€”Developed by: Defog, Inc
  • โ€”Model type: [Text to SQL]
  • โ€”License: [CC-by-SA-4.0]
  • โ€”Finetuned from model: [CodeLlama-7B]

Model Sources [optional]

Uses

This model is intended to be used by non-technical users to understand data inside their SQL databases. It is meant as an analytics tool, and not as a database admin tool.

This model has not been trained to reject malicious requests from users with write access to databases, and should only be used by users with read-only access.

How to Get Started with the Model

Use the code here to get started with the model.

Prompt

Please use the following prompt for optimal results. Please remember to use do_sample=False and num_beams=4 for optimal results.

### Task
Generate a SQL query to answer [QUESTION]{user_question}[/QUESTION]

### Database Schema
The query will run on a database with the following schema:
{table_metadata_string_DDL_statements}

### Answer
Given the database schema, here is the SQL query that [QUESTION]{user_question}[/QUESTION]
[SQL]

Evaluation

This model was evaluated on SQL-Eval, a PostgreSQL based evaluation framework developed by Defog for testing and alignment of model capabilities.

You can read more about the methodology behind SQLEval here.

Results

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

dategroup_byorder_byratiojoinwhere
sqlcoder-70b9691.497.185.797.191.4
sqlcoder-7b-29691.494.391.494.377.1
sqlcoder-34b8094.385.777.185.780
gpt-47294.397.18091.480
gpt-4-turbo7691.491.462.888.677.1
natural-sql-7b5688.685.76088.680
sqlcoder-7b6482.974.354.374.374.3
gpt-3.57277.182.834.365.771.4
claude-25271.474.357.165.762.9

Model Card Contact

Contact us on X at @defogdata, or on email at founders@defog.ai