Update README.md
Browse files
README.md
CHANGED
@@ -3,4 +3,32 @@ license: mit
|
|
3 |
base_model:
|
4 |
- deepseek-ai/DeepSeek-R1
|
5 |
library_name: mlx
|
6 |
-
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
base_model:
|
4 |
- deepseek-ai/DeepSeek-R1
|
5 |
library_name: mlx
|
6 |
+
---
|
7 |
+
|
8 |
+
# mlx-community/DeepSeek-R1
|
9 |
+
|
10 |
+
The Model [mlx-community/DeepSeek-R1](https://huggingface.co/mlx-community/DeepSeek-R1) was
|
11 |
+
converted to MLX format from [deepseek-ai/DeepSeek-R1](https://huggingface.co/deepseek-ai/DeepSeek-R1)
|
12 |
+
using mlx-lm version **0.22.1**.
|
13 |
+
|
14 |
+
## Use with mlx
|
15 |
+
|
16 |
+
```bash
|
17 |
+
pip install mlx-lm
|
18 |
+
```
|
19 |
+
|
20 |
+
```python
|
21 |
+
from mlx_lm import load, generate
|
22 |
+
|
23 |
+
model, tokenizer = load("mlx-community/DeepSeek-R1")
|
24 |
+
|
25 |
+
prompt = "hello"
|
26 |
+
|
27 |
+
if tokenizer.chat_template is not None:
|
28 |
+
messages = [{"role": "user", "content": prompt}]
|
29 |
+
prompt = tokenizer.apply_chat_template(
|
30 |
+
messages, add_generation_prompt=True
|
31 |
+
)
|
32 |
+
|
33 |
+
response = generate(model, tokenizer, prompt=prompt, verbose=True)
|
34 |
+
```
|