Update README.md
Browse files
README.md
CHANGED
@@ -1,38 +1,24 @@
|
|
1 |
-
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
The following YAML configuration was used to produce this model:
|
27 |
-
|
28 |
-
```yaml
|
29 |
-
slices:
|
30 |
-
- sources:
|
31 |
-
- model: deepseek-ai/DeepSeek-R1-Distill-Llama-8B
|
32 |
-
layer_range: [0, 24]
|
33 |
-
- sources:
|
34 |
-
- model: deepseek-ai/DeepSeek-R1-Distill-Llama-8B
|
35 |
-
layer_range: [8, 32]
|
36 |
-
merge_method: passthrough
|
37 |
-
dtype: bfloat16
|
38 |
-
```
|
|
|
1 |
+
```python
|
2 |
+
import transformers
|
3 |
+
import torch
|
4 |
+
|
5 |
+
model_id = "miike-ai/r1-12b"
|
6 |
+
|
7 |
+
pipeline = transformers.pipeline(
|
8 |
+
"text-generation",
|
9 |
+
model=model_id,
|
10 |
+
model_kwargs={"torch_dtype": torch.bfloat16},
|
11 |
+
device_map="auto",
|
12 |
+
)
|
13 |
+
|
14 |
+
messages = [
|
15 |
+
{"role": "system", "content": "You are a pirate chatbot who always responds in pirate speak!"},
|
16 |
+
{"role": "user", "content": "Who are you?"},
|
17 |
+
]
|
18 |
+
|
19 |
+
outputs = pipeline(
|
20 |
+
messages,
|
21 |
+
max_new_tokens=8192,
|
22 |
+
)
|
23 |
+
print(outputs[0]["generated_text"][-1])
|
24 |
+
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|