Downloads · 30 days
4
14% of all-time downloads
alifgokce/wwi-sql-assistant-lora
wwi-sql-assistant-lora is a machine learning model from alifgokce. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for peft. The card lists the license as apache-2.0.
Domain-specific SQL asistanı. Qwen2.5-Coder-7B-Instruct üzerine LoRA ile eğitilmiştir.
Downloads · 30 days
4
14% of all-time downloads
All-time downloads
28
Public
Repo size
334 MB
Likes
0
Public
Click a slice to open those files.
.safetensors323 MB · 96%
From the Hugging Face model README
Domain-specific SQL asistanı. Qwen2.5-Coder-7B-Instruct üzerine LoRA ile eğitilmiştir.
WideWorldImporters (Microsoft örnek veritabanı) stored procedure'leri için Türkçe ve İngilizce soru-cevap, NL2SQL çevirisi ve SQL sonuç özetleme yetenekleri kazandırılmıştır.
CREATE OR ALTER PROCEDURE şablonlarıFOR SYSTEM_TIME AS OF sorguları| Parametre | Değer |
|---|---|
| Base model | Qwen2.5-Coder-7B-Instruct |
| LoRA rank | 32 |
| LoRA alpha | 64 |
| Hedef modüller | q/k/v/o_proj + gate/up/down_proj (7 modül) |
| Eğitilebilir parametre | %1.05 |
| Dataset | 2718 örnek (TR+EN bilingual) |
| Epoch | 15 |
| Batch size (eff.) | 8 |
| Final loss | ~0.05 |
| Donanım | RTX 5090 (WSL2) |
from peft import PeftModel
from transformers import AutoModelForCausalLM, AutoTokenizer
import torch
base = AutoModelForCausalLM.from_pretrained(
"Qwen/Qwen2.5-Coder-7B-Instruct",
dtype=torch.bfloat16,
device_map="auto",
)
model = PeftModel.from_pretrained(base, "alifgokce/wwi-sql-assistant-lora")
tok = AutoTokenizer.from_pretrained("Qwen/Qwen2.5-Coder-7B-Instruct")
messages = [
{"role": "system", "content": "Sen WideWorldImporters veritabanı için uzman bir SQL asistanısın."},
{"role": "user", "content": "Website.SearchForCustomers nasıl çalıştırılır?"},
]
prompt = tok.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = tok(prompt, return_tensors="pt").to(model.device)
with torch.inference_mode():
out = model.generate(**inputs, max_new_tokens=256, do_sample=False)
print(tok.decode(out[0][inputs["input_ids"].shape[1]:], skip_special_tokens=True))
SP Sorusu (TR):
Website.SearchForCustomers hangi parametreleri alır?
Website.SearchForCustomers aşağıdaki parametreleri alır:
• @SearchText (nvarchar)
• @MaximumRowsToReturn (int)
EXEC Website.SearchForCustomers @SearchText=<deger>, @MaximumRowsToReturn=<deger>;
NL2SQL (TR):
En çok sipariş veren 10 müşteriyi listele.
SELECT TOP 10
c.CustomerID,
c.CustomerName,
COUNT(o.OrderID) AS OrderCount
FROM Sales.Customers c
JOIN Sales.Orders o ON o.CustomerID = c.CustomerID
GROUP BY c.CustomerID, c.CustomerName
ORDER BY OrderCount DESC;
Eğitim dataseti aynı repoda finetune_dataset_v4.jsonl olarak mevcuttur.
Kategoriler: explain, exec, param_explain, nl2sql, sp_writing, intent_classification,
correlated_subquery, dynamic_schema, realtime_data, result_summary
Apache 2.0