Upload README.md with huggingface_hub
Browse files
README.md
ADDED
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
license: llama3.1
|
3 |
+
language:
|
4 |
+
- en
|
5 |
+
pipeline_tag: text-generation
|
6 |
+
datasets:
|
7 |
+
- allenai/tulu-3-sft-mixture
|
8 |
+
base_model: allenai/Llama-3.1-Tulu-3-8B-SFT
|
9 |
+
library_name: transformers
|
10 |
+
tags:
|
11 |
+
- mlx
|
12 |
+
---
|
13 |
+
|
14 |
+
# cnfusion/Llama-3.1-Tulu-3-8B-SFT-Q4-mlx
|
15 |
+
|
16 |
+
The Model [cnfusion/Llama-3.1-Tulu-3-8B-SFT-Q4-mlx](https://huggingface.co/cnfusion/Llama-3.1-Tulu-3-8B-SFT-Q4-mlx) was converted to MLX format from [allenai/Llama-3.1-Tulu-3-8B-SFT](https://huggingface.co/allenai/Llama-3.1-Tulu-3-8B-SFT) using mlx-lm version **0.19.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("cnfusion/Llama-3.1-Tulu-3-8B-SFT-Q4-mlx")
|
28 |
+
|
29 |
+
prompt="hello"
|
30 |
+
|
31 |
+
if hasattr(tokenizer, "apply_chat_template") and tokenizer.chat_template is not None:
|
32 |
+
messages = [{"role": "user", "content": prompt}]
|
33 |
+
prompt = tokenizer.apply_chat_template(
|
34 |
+
messages, tokenize=False, add_generation_prompt=True
|
35 |
+
)
|
36 |
+
|
37 |
+
response = generate(model, tokenizer, prompt=prompt, verbose=True)
|
38 |
+
```
|