Views
No views yet
unsloth/Llama-3.2-3B-Instruct-bnb-4bit, specifically trained to translate natural language questions into accurate, executable PostgreSQL queries.Q4_K_M (4-bit quantization. This provides an excellent balance between memory usage, inference speed, and model quality).saved_finetuned_q4_k_m.gguf file to your local machine.Modelfile in the same directory with the following content:1FROM ./saved_finetuned_q4_k_m.gguf
2
3SYSTEM """You are SQL-Llama, a specialized Text-to-SQL assistant.
4For all inputs, you MUST output ONLY valid SQL code. Do not include markdown blocks or conversational filler."""
5
6TEMPLATE """<|begin_of_text|><|start_header_id|>system<|end_header_id|>
7
8{{ .System }}<|eot_id|><|start_header_id|>user<|end_header_id|>
9
10{{ .Prompt }}<|eot_id|><|start_header_id|>assistant<|end_header_id|>
11
12"""1# Build the model
2ollama create natural2sql -f Modelfile
3
4# Run the model
5ollama run natural2sqlContext and your inquiry as Question:1Context: CREATE TABLE sales (transaction_id INT, product_name TEXT, amount DECIMAL, sale_date DATE, region TEXT);
2Question: What was the total revenue from the 'North' region for transactions occurring after January 2023?LICENSE file).