Views
No views yet
Q4_K_M GGUF quantized version is available for efficient local inference with llama.cpp and other GGUF-compatible runtimes:| Parameter | Value |
|---|---|
| Base Model | meta-llama/Llama-3.2-3B |
| Fine-tuning Method | QLoRA |
| Base Model Quantization During Training | 4-bit |
| LoRA Rank | 16 |
| Training Dataset | gretelai/synthetic_text_to_sql |
| Dataset Split Used | Test split |
| Training Samples | ~5.85K |
| Epochs | 1 |
| Batch Size | 8 |
| Training Time | ~30 minutes |
Note: This experiment used the dataset's test split for fine-tuning rather than the training split. Therefore, the original test split should not be used to report an unbiased evaluation score for this model.
1from transformers import AutoTokenizer, AutoModelForCausalLM
2
3model_id = "farehaheha/llama3.2-3B-text-to-sql"
4
5tokenizer = AutoTokenizer.from_pretrained(model_id)
6
7model = AutoModelForCausalLM.from_pretrained(
8 model_id,
9 device_map="auto",
10 torch_dtype="auto",
11)
12
13prompt = """### Database Schema:
14{your_database_schema}
15
16### Request:
17{your_natural_language_request}
18
19### SQL Query:
20"""
21
22inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
23
24outputs = model.generate(
25 **inputs,
26 max_new_tokens=256,
27 do_sample=False,
28)
29
30response = tokenizer.decode(outputs[0], skip_special_tokens=True)
31print(response)