Downloads · 30 days
0
giangkh19/qwen3.5-4b-sql
qwen3.5-4b-sql is a text generation model from giangkh19. Use it when you need the model to write or continue text. The card lists the license as apache-2.0.
Mô hình chuyên sâu về Text-to-SQL phức tạp, được fine-tune từ Qwen/Qwen3.5-4B bằng công nghệ QLoRA 4-bit (Unsloth) trên tập dữ liệu tuyển chọn 17.000 mẫu nâng cao (kết hợp từ Gretel AI, Spider, và BIRD-Bench).
Downloads · 30 days
0
Access
Public
Updated Sep 3, 2026
Repo size
105 MB
Likes
0
Public
Click a slice to open those files.
.safetensors85 MB · 81%
From the Hugging Face model README
Mô hình chuyên sâu về Text-to-SQL phức tạp, được fine-tune từ Qwen/Qwen3.5-4B bằng công nghệ QLoRA 4-bit (Unsloth) trên tập dữ liệu tuyển chọn 17.000 mẫu nâng cao (kết hợp từ Gretel AI, Spider, và BIRD-Bench).
Mô hình hỗ trợ Native Reasoning (<think> ... </think>), tự động suy luận cấu trúc bảng, liên kết khóa ngoại và điều kiện logic trước khi sinh câu lệnh SQL chuẩn SQLite.
Không cần tải file thủ công, Ollama hỗ trợ kéo trực tiếp từ Hugging Face:
ollama run hf.co/giangkh19/qwen3.5-4b-sql-gguf:Q4_K_M
Yêu cầu phần cứng: Chạy siêu mượt trên máy tính cá nhân (chỉ cần 4GB VRAM GPU như GTX 1650 hoặc 8GB RAM nếu chạy CPU).
<|im_start|>system
You are a SQLite expert. Given the database schema, write the correct SQL query.
### DATABASE SCHEMA:
CREATE TABLE customers (id INT PRIMARY KEY, name TEXT, tier TEXT);
CREATE TABLE orders (order_id INT, customer_id INT, amount REAL, FOREIGN KEY(customer_id) REFERENCES customers(id));
<|im_end|>
<|im_start|>user
Find top 3 VIP customers with total spent over 500?
<|im_end|>
<|im_start|>assistant
<think>
1. Identify target tables: 'customers' and 'orders'.
2. Join condition: customers.id = orders.customer_id.
3. Filter conditions: tier = 'VIP'.
4. Aggregation: SUM(amount) grouped by customers.id having sum > 500.
5. Sort descending and limit to 3.
</think>
SELECT c.name, SUM(o.amount) AS total_spent
FROM customers c
JOIN orders o ON c.id = o.customer_id
WHERE c.tier = 'VIP'
GROUP BY c.id, c.name
HAVING total_spent > 500
ORDER BY total_spent DESC
LIMIT 3;
<|im_end|>
Đã loại bỏ 100% các câu đơn giản (1 bảng). Toàn bộ dữ liệu được chọn lọc khắt khe:
AND/OR), xử lý ngày tháng (strftime), tính toán tỷ lệ.GROUP BY, HAVING, CASE WHEN, UNION, EXCEPT, WINDOW functions và CTEs.Qwen/Qwen3.5-4B (4-bit NF4 Quantization)q, k, v, o, gate, up, down)train_on_responses_only (chỉ tính điểm phạt trên câu lệnh SQL, không phạt trên Schema)