Views
No views yet
1Database schema: CREATE TABLE employees (id INT, name TEXT, salary FLOAT);
2Prompt: List all employees with salary over 50000.1SQL: SELECT name FROM employees WHERE salary > 50000;
2Explanation: This query retrieves all employee names where the salary is greater than 50000.max_seq_length=1024batch_size=2, gradient_accumulation_steps=2packing=True to maximize throughput| Metric | Result |
|---|---|
| SQL compilation success | > 95% |
| Manual output quality | ~90%+ |
| Explanation clarity | High |
1from transformers import AutoTokenizer, AutoModelForCausalLM
2
3model_id = "happyhackingspace/llama3-sql-translator"
4tokenizer = AutoTokenizer.from_pretrained(model_id)
5model = AutoModelForCausalLM.from_pretrained(model_id)
6
7prompt = """Below is an instruction that describes a task, paired with an input that provides further context.
8Write a response that appropriately completes the request.
9
10### Instruction
11Database schema: CREATE TABLE sales (id INT, product TEXT, price FLOAT);
12
13### Input:
14Prompt: Show all products priced over 100.
15
16### Response:"""
17
18inputs = tokenizer(prompt, return_tensors="pt")
19outputs = model.generate(**inputs, max_new_tokens=256)
20print(tokenizer.decode(outputs[0], skip_special_tokens=True))1@misc{llama3_sql_translator_2025,
2 title = {Llama3 SQL Translator},
3 author = {happyhackingspace},
4 year = {2025},
5 howpublished = {\url{https://huggingface.co/happyhackingspace/llama3-sql-translator}}
6}