Upload README.md with huggingface_hub
Browse files
README.md
ADDED
@@ -0,0 +1,40 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
library_name: transformers
|
3 |
+
license: apache-2.0
|
4 |
+
language:
|
5 |
+
- en
|
6 |
+
pipeline_tag: text-generation
|
7 |
+
tags:
|
8 |
+
- safetensors
|
9 |
+
- onnx
|
10 |
+
- transformers.js
|
11 |
+
- mlx
|
12 |
+
- mlx-my-repo
|
13 |
+
base_model: HuggingFaceTB/SmolLM2-135M-Instruct
|
14 |
+
---
|
15 |
+
|
16 |
+
# reach-vb/SmolLM2-135M-Instruct-Q8-mlx
|
17 |
+
|
18 |
+
The Model [reach-vb/SmolLM2-135M-Instruct-Q8-mlx](https://huggingface.co/reach-vb/SmolLM2-135M-Instruct-Q8-mlx) was converted to MLX format from [HuggingFaceTB/SmolLM2-135M-Instruct](https://huggingface.co/HuggingFaceTB/SmolLM2-135M-Instruct) using mlx-lm version **0.19.2**.
|
19 |
+
|
20 |
+
## Use with mlx
|
21 |
+
|
22 |
+
```bash
|
23 |
+
pip install mlx-lm
|
24 |
+
```
|
25 |
+
|
26 |
+
```python
|
27 |
+
from mlx_lm import load, generate
|
28 |
+
|
29 |
+
model, tokenizer = load("reach-vb/SmolLM2-135M-Instruct-Q8-mlx")
|
30 |
+
|
31 |
+
prompt="hello"
|
32 |
+
|
33 |
+
if hasattr(tokenizer, "apply_chat_template") and tokenizer.chat_template is not None:
|
34 |
+
messages = [{"role": "user", "content": prompt}]
|
35 |
+
prompt = tokenizer.apply_chat_template(
|
36 |
+
messages, tokenize=False, add_generation_prompt=True
|
37 |
+
)
|
38 |
+
|
39 |
+
response = generate(model, tokenizer, prompt=prompt, verbose=True)
|
40 |
+
```
|