Upload README.md with huggingface_hub
Browse files
README.md
ADDED
@@ -0,0 +1,47 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
base_model: unsloth/Phi-4-mini-instruct
|
3 |
+
license: mit
|
4 |
+
license_link: https://huggingface.co/microsoft/Phi-4-mini-instruct/resolve/main/LICENSE
|
5 |
+
language:
|
6 |
+
- multilingual
|
7 |
+
pipeline_tag: text-generation
|
8 |
+
tags:
|
9 |
+
- phi
|
10 |
+
- phi4
|
11 |
+
- unsloth
|
12 |
+
- nlp
|
13 |
+
- code
|
14 |
+
- microsoft
|
15 |
+
- math
|
16 |
+
- chat
|
17 |
+
- conversational
|
18 |
+
- mlx
|
19 |
+
- mlx-my-repo
|
20 |
+
library_name: transformers
|
21 |
+
---
|
22 |
+
|
23 |
+
# maxrubin629/Phi-4-mini-instruct-Q8-mlx
|
24 |
+
|
25 |
+
The Model [maxrubin629/Phi-4-mini-instruct-Q8-mlx](https://huggingface.co/maxrubin629/Phi-4-mini-instruct-Q8-mlx) was converted to MLX format from [unsloth/Phi-4-mini-instruct](https://huggingface.co/unsloth/Phi-4-mini-instruct) using mlx-lm version **0.21.5**.
|
26 |
+
|
27 |
+
## Use with mlx
|
28 |
+
|
29 |
+
```bash
|
30 |
+
pip install mlx-lm
|
31 |
+
```
|
32 |
+
|
33 |
+
```python
|
34 |
+
from mlx_lm import load, generate
|
35 |
+
|
36 |
+
model, tokenizer = load("maxrubin629/Phi-4-mini-instruct-Q8-mlx")
|
37 |
+
|
38 |
+
prompt="hello"
|
39 |
+
|
40 |
+
if hasattr(tokenizer, "apply_chat_template") and tokenizer.chat_template is not None:
|
41 |
+
messages = [{"role": "user", "content": prompt}]
|
42 |
+
prompt = tokenizer.apply_chat_template(
|
43 |
+
messages, tokenize=False, add_generation_prompt=True
|
44 |
+
)
|
45 |
+
|
46 |
+
response = generate(model, tokenizer, prompt=prompt, verbose=True)
|
47 |
+
```
|