Downloads · 30 days
10
25% of all-time downloads
mehmet1899/llama32-3b-instruct-nl2sql-lora
llama32-3b-instruct-nl2sql-lora is a text generation model from mehmet1899. Use it when you need the model to write or continue text. It is set up for peft.
This repository contains the final LoRA adapter for the Llama 3.2 3B Instruct model line used in a master's thesis project on local large language models for NL2SQL generation.
Downloads · 30 days
10
25% of all-time downloads
All-time downloads
40
Public
Repo size
65.9 MB
Likes
0
Public
Click a slice to open those files.
.safetensors48.7 MB · 74%
From the Hugging Face model README
This repository contains the final LoRA adapter for the Llama 3.2 3B Instruct model line used in a master's thesis project on local large language models for NL2SQL generation.
The adapter generates SQLite queries from natural-language questions and a relational database schema. It must be loaded together with the corresponding base model.
meta-llama/Llama-3.2-3B-Instruct0cb88a4f764b7a12671c53f0838cd831a0843b95checkpoint-509SHA-256 of adapter_model.safetensors:
fcd4241f7a2e8e0388f13f0dd9517486cbee43fc3169c983a54e7b716c0e502d
1e-4Spider Dev was not used for training, validation, early stopping, or checkpoint selection.
The final adapter was evaluated on all 1,032 Spider Dev cases.
Zero-shot evaluation:
The corresponding starting model achieved an Execution Match Accuracy of 55.04% (568/1,032) under the same zero-shot evaluation condition.
The model is instructed to return only a valid SQLite query:
SELECT or WITH queriesThe native Llama chat template and the exact project-specific prompt construction are documented in the accompanying GitHub repository.
import torch
from peft import PeftModel
from transformers import AutoModelForCausalLM, AutoTokenizer
base_model_id = "meta-llama/Llama-3.2-3B-Instruct"
adapter_id = "mehmet1899/llama32-3b-instruct-nl2sql-lora"
adapter_revision = "87afdd0c565da4570ebd129a4098f50719e0f76e"
tokenizer = AutoTokenizer.from_pretrained(
base_model_id,
revision="0cb88a4f764b7a12671c53f0838cd831a0843b95",
)
model = AutoModelForCausalLM.from_pretrained(
base_model_id,
revision="0cb88a4f764b7a12671c53f0838cd831a0843b95",
torch_dtype=torch.float16,
device_map="auto",
)
model = PeftModel.from_pretrained(
model,
adapter_id,
revision=adapter_revision,
)
model.eval()
Code, training and evaluation configurations, environment information, run manifests, and result summaries are available at:
https://github.com/md181099/nl2sql-masterthesis
The files training_metadata.json, training_history.csv, and training_history.jsonl provide additional training provenance.