Update README.md
Browse files
README.md
CHANGED
@@ -5,6 +5,34 @@ tags:
|
|
5 |
- language
|
6 |
- granite-4.0
|
7 |
- mlx
|
|
|
8 |
pipeline_tag: text-generation
|
9 |
-
base_model: ibm-granite/granite-4.0-h-tiny
|
10 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5 |
- language
|
6 |
- granite-4.0
|
7 |
- mlx
|
8 |
+
base_model: ibm-granite/granite-4.0-h-micro
|
9 |
pipeline_tag: text-generation
|
|
|
10 |
---
|
11 |
+
|
12 |
+
# mlx-community/granite-4.0-h-tiny-4bit
|
13 |
+
|
14 |
+
This model [mlx-community/granite-4.0-h-tiny-4bit](https://huggingface.co/mlx-community/granite-4.0-h-tiny-4bit) was
|
15 |
+
converted to MLX format from [ibm-granite/granite-4.0-h-tiny](https://huggingface.co/ibm-granite/granite-4.0-h-tiny)
|
16 |
+
using mlx-lm version **0.28.2**.
|
17 |
+
|
18 |
+
## Use with mlx
|
19 |
+
|
20 |
+
```bash
|
21 |
+
pip install mlx-lm
|
22 |
+
```
|
23 |
+
|
24 |
+
```python
|
25 |
+
from mlx_lm import load, generate
|
26 |
+
|
27 |
+
model, tokenizer = load("mlx-community/granite-4.0-h-tiny-4bit")
|
28 |
+
|
29 |
+
prompt = "hello"
|
30 |
+
|
31 |
+
if tokenizer.chat_template is not None:
|
32 |
+
messages = [{"role": "user", "content": prompt}]
|
33 |
+
prompt = tokenizer.apply_chat_template(
|
34 |
+
messages, add_generation_prompt=True
|
35 |
+
)
|
36 |
+
|
37 |
+
response = generate(model, tokenizer, prompt=prompt, verbose=True)
|
38 |
+
```
|