Views
No views yet
You: "What is the total population of cities in Switzerland (CH)?"
→ SELECT SUM(population) FROM cities WHERE country = 'CH'mlx-lm:pip install mlx-lm1from mlx_lm import load, generate
2
3model, tokenizer = load("ulldma/Qwen3.5-0.8B-OptiQ-4bit-text-to-sql")
4
5schema = (
6 "CREATE TABLE employees (Name VARCHAR, Department VARCHAR, "
7 "Salary INT, Start_Date DATE);"
8)
9prompt = f"{schema}\nQ: Who earns more than 100k in Engineering?\nA: "
10
11response = generate(model, tokenizer, prompt=prompt, max_tokens=100)
12print(response)
13# SELECT Name FROM employees WHERE Department = 'Engineering' AND Salary > 100000;1python -m mlx_lm generate \
2 --model ulldma/Qwen3.5-0.8B-OptiQ-4bit-text-to-sql \
3 --max-tokens 100 \
4 --prompt "CREATE TABLE cities (name VARCHAR, country_code VARCHAR, population INT);
5Q: What is the total population of cities in Switzerland (CH)?
6A: "CREATE TABLE ... ; [INSERT INTO ... VALUES (...);]
Q: <natural language question>
A:A: line with a single SQL statement.| Parameter | Value |
|---|---|
| Method | LoRA |
| Base model | Qwen3.5-0.8B (4-bit, MLX/OptiQ) |
| Rank / scale / dropout | 8 / 20.0 / 0.0 |
| Target layers | 16 |
| Optimizer | AdamW-family (Adam), LR schedule: constant |
| Learning rate | 1e-5 |
| Iterations | 600 (batch size 2, grad checkpointing) |
| Max sequence length | 512 |
uv sync → train → eval).