Downloads · 30 days
6
20% of all-time downloads
mehmet1899/qwen35-2b-nl2sql-lora
qwen35-2b-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 Qwen 3.5 2B model line used in a master's thesis project on local large language models for NL2SQL generation.
Downloads · 30 days
6
20% of all-time downloads
All-time downloads
30
Public
Repo size
53.7 MB
Likes
0
Public
Click a slice to open those files.
.safetensors33.7 MB · 63%
From the Hugging Face model README
This repository contains the final LoRA adapter for the Qwen 3.5 2B 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.
Qwen/Qwen3.5-2B-Baseb1485b2fa6dfa1287294f269f5fb618e03d52d7ccheckpoint-502SHA-256 of adapter_model.safetensors:
6b92f120365d127d0c51a4c532953207d65cff611ac08cb7d573880be18223f3
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:
These values correspond to the authoritative evaluation run documented in the accompanying GitHub repository.
The model is instructed to return only a valid SQLite query:
SELECT or WITH queriesThe exact prompt construction and evaluation pipeline are documented in the project repository.
import torch
from peft import PeftModel
from transformers import AutoModelForCausalLM, AutoTokenizer
base_model_id = "Qwen/Qwen3.5-2B-Base"
adapter_id = "mehmet1899/qwen35-2b-nl2sql-lora"
adapter_revision = "c6373ca847220b446d3d84859e914f89dc208375"
tokenizer = AutoTokenizer.from_pretrained(
base_model_id,
revision="b1485b2fa6dfa1287294f269f5fb618e03d52d7c",
)
model = AutoModelForCausalLM.from_pretrained(
base_model_id,
revision="b1485b2fa6dfa1287294f269f5fb618e03d52d7c",
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.