Files changed (1) hide show
  1. README.md +25 -10
README.md CHANGED
@@ -1,19 +1,17 @@
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/QwQ-32B-Preview-gptqmodel-4bit-vortex-v3"
9
- mlx_path = f"./vortex/QwQ-32B-Preview-gptqmodel-4bit-vortex-mlx-v3"
 
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
 
@@ -23,4 +21,21 @@ prompt = tokenizer.apply_chat_template(
23
  )
24
 
25
  text = generate(mlx_model, tokenizer, prompt=prompt, verbose=True)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
26
  ```
 
1
+ This model was exported using [GPTQModel](https://github.com/ModelCloud/GPTQModel).
2
 
3
+ ## How to run this model
 
 
4
 
5
+ ```shell
6
+ # install mlx
7
+ pip install mlx_lm
8
+ ```
9
 
 
 
10
 
11
+ ```python
12
  from mlx_lm import load, generate
13
 
14
+ mlx_path = "ModelCloud/QwQ-32B-Preview-gptqmodel-4bit-vortex-mlx-v3"
15
  mlx_model, tokenizer = load(mlx_path)
16
  prompt = "The capital of France is"
17
 
 
21
  )
22
 
23
  text = generate(mlx_model, tokenizer, prompt=prompt, verbose=True)
24
+ ```
25
+
26
+ ### Export gptq to mlx
27
+ ```shell
28
+ # install gptqmodel with mlx
29
+ pip install gptqmodel[mlx] --no-build-isolation
30
+ ```
31
+
32
+ ```python
33
+ from gptqmodel import GPTQModel
34
+
35
+ # load gptq quantized model
36
+ gptq_model_path = "ModelCloud/QwQ-32B-Preview-gptqmodel-4bit-vortex-v3"
37
+ mlx_path = f"./vortex/QwQ-32B-Preview-gptqmodel-4bit-vortex-mlx-v3"
38
+
39
+ # export to mlx model
40
+ GPTQModel.export(gptq_model_path, mlx_path, "mlx")
41
  ```