在 MLX 上使用 LoRA / QLoRA 微调 Text2SQL(三):分享微调后的模型到 HuggingFace Hub
mlx-community/Mistral-7B-v0.1-LoRA-Text2SQL
安装 mlx-lm
pip install mlx-lm
生成 SQL
python -m mlx_lm.generate --model mlx-community/Mistral-7B-v0.1-LoRA-Text2SQL \
--max-tokens 50 \
--prompt "table: students
columns: Name, Age, School, Grade, Height, Weight
Q: Which school did Wang Junjian come from?
A: "
SELECT School FROM Students WHERE Name = 'Wang Junjian'
上传模型到 HuggingFace Hub
- 加入 MLX Community 组织
- 在 MLX Community 组织中创建一个新的模型 mlx-community/Mistral-7B-v0.1-LoRA-Text2SQL