Create README.md
Browse files
README.md
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
This model was exported using [GPTQModel](https://github.com/ModelCloud/GPTQModel). Below is example code for exporting a model from GPTQ format to MLX format.
|
| 2 |
+
|
| 3 |
+
## Example:
|
| 4 |
+
```python
|
| 5 |
+
from gptqmodel import GPTQModel
|
| 6 |
+
|
| 7 |
+
# load gptq quantized model
|
| 8 |
+
gptq_model_path = "ModelCloud/Llama-3.2-1B-Instruct-gptqmodel-4bit-vortex-v2.5"
|
| 9 |
+
mlx_path = f"./vortex/Llama-3.2-1B-Instruct-gptqmodel-4bit-vortex-v2.5-mlx"
|
| 10 |
+
|
| 11 |
+
# export to mlx model
|
| 12 |
+
GPTQModel.export(gptq_model_path, mlx_path, "mlx")
|
| 13 |
+
|
| 14 |
+
# load mlx model check if it works
|
| 15 |
+
from mlx_lm import load, generate
|
| 16 |
+
|
| 17 |
+
mlx_model, tokenizer = load(mlx_path)
|
| 18 |
+
prompt = "The capital of France is"
|
| 19 |
+
|
| 20 |
+
messages = [{"role": "user", "content": prompt}]
|
| 21 |
+
prompt = tokenizer.apply_chat_template(
|
| 22 |
+
messages, add_generation_prompt=True
|
| 23 |
+
)
|
| 24 |
+
|
| 25 |
+
text = generate(mlx_model, tokenizer, prompt=prompt, verbose=True)
|
| 26 |
+
```
|