Update README.md
Browse files
README.md
CHANGED
@@ -19,5 +19,22 @@ using mlx-lm version **0.21.1**.
|
|
19 |
## Use with mlx
|
20 |
|
21 |
|
22 |
-
|
23 |
Find some guidance here: https://github.com/ml-explore/mlx-examples/blob/main/llms/README.md
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
19 |
## Use with mlx
|
20 |
|
21 |
|
22 |
+
Poritng VM capabilities to Apple Silicon pending.
|
23 |
Find some guidance here: https://github.com/ml-explore/mlx-examples/blob/main/llms/README.md
|
24 |
+
|
25 |
+
|
26 |
+
```python
|
27 |
+
from mlx_lm import load, generate
|
28 |
+
|
29 |
+
model, tokenizer = load("Casalioy/Janus-Pro-1B-q4-Casa_MLX")
|
30 |
+
|
31 |
+
prompt = "What's the meaning of Casalioy Collective?"
|
32 |
+
|
33 |
+
if tokenizer.chat_template is not None:
|
34 |
+
messages = [{"role": "user", "content": prompt}]
|
35 |
+
prompt = tokenizer.apply_chat_template(
|
36 |
+
messages, add_generation_prompt=True
|
37 |
+
)
|
38 |
+
|
39 |
+
response = generate(model, tokenizer, prompt=prompt, verbose=True)
|
40 |
+
```
|