qm9 commited on
Commit
bce15ca
·
verified ·
1 Parent(s): 9677e48

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +18 -1
README.md CHANGED
@@ -19,5 +19,22 @@ using mlx-lm version **0.21.1**.
19
  ## Use with mlx
20
 
21
 
22
- Port to Apple Silicon pending.
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
+ ```