Downloads · 30 days
11
10% of all-time downloads
Azzedde/llama3.2-3b-sql-expert-1-epoch
llama3.2-3b-sql-expert-1-epoch is a text generation model from Azzedde. Use it when you need the model to write or continue text. It is set up for transformers. The card lists the license as apache-2.0.
Llama3.2-3B-SQL-Expert-1Epoch is a fine-tuned version of Meta’s Llama-3.1-3B, specifically optimized for generating SQL queries from natural language input. The model has been trained using Unsloth for efficient fine-…
Downloads · 30 days
11
10% of all-time downloads
All-time downloads
106
Public
Repo size
12.9 GB
Likes
0
Public
Click a slice to open those files.
.bin6.4 GB · 100%
From the Hugging Face model README
Llama3.2-3B-SQL-Expert-1Epoch is a fine-tuned version of Meta’s Llama-3.1-3B, specifically optimized for generating SQL queries from natural language input. The model has been trained using Unsloth for efficient fine-tuning and inference.
This model is designed for generating SQL queries based on natural language inputs and is useful for:
Users should:
Use the following code to load and use the model:
from unsloth import FastLanguageModel
from transformers import AutoTokenizer
# Load tokenizer and model
tokenizer = AutoTokenizer.from_pretrained("Azzedde/llama3.2-3b-sql-expert-1-epoch")
model = FastLanguageModel.from_pretrained("Azzedde/llama3.2-3b-sql-expert-1-epoch")
# Example inference
sql_prompt = """Below is a SQL database schema and a question. Generate an SQL query to answer the question.
### Schema:
{schema}
### Question:
{question}
### SQL Query:
"""
input_text = sql_prompt.format(
schema="CREATE TABLE employees (id INT PRIMARY KEY, name VARCHAR, salary DECIMAL, department_id INT);",
question="Find the average salary per department."
)
# Tokenize and generate query
inputs = tokenizer(input_text, return_tensors="pt").to("cuda")
outputs = model.generate(**inputs, max_new_tokens=64, use_cache=True)
print(tokenizer.decode(outputs[0]))
batch_size = 4gradient_accumulation_steps = 8num_train_epochs = 1learning_rate = 2e-4fp16 = Trueunsloth, transformers, TRL, datasets@article{llama3.2-3B-SQL-Expert,
author = {Azzedde},
title = {Llama3.2-3B-SQL-Expert: An SQL Query Generation Model},
year = {2025},
url = {https://huggingface.co/Azzedde/llama3.2-3b-sql-expert-1-epoch}
}
Azzedde. (2025). Llama3.2-3B-SQL-Expert: An SQL Query Generation Model. Retrieved from Hugging Face
For questions, reach out via Hugging Face discussions or GitHub issues.