在 MLX 上使用 LoRA / QLoRA 微调 Text2SQL(四):使用 QLoRA 基于 Mistral-7B 微调
预训练模型 mistralai/Mistral-7B-v0.1
量化
QLoRA 微调需要量化,生成 4 位量化的 Mistral 7B 并默认将其存储在 mlx_model 目录中
python convert.py --hf-path mistralai/Mistral-7B-v0.1 -q
mlx_model 目录结构如下:
mlx_model
├── config.json
├── model.safetensors
├── special_tokens_map.json
├── tokenizer.json
├── tokenizer.model
├── tokenizer_config.json
└── weights.00.safetensors
量化后的模型 8.0G
微调
QLoRA 微调



















