File size: 608 Bytes
9c33b36
 
 
 
 
933c0c1
9c33b36
32963ff
 
 
 
4b0551e
32963ff
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
27
28
---
datasets:
- HuggingFaceH4/ultrachat_200k
base_model:
- meta-llama/Llama-3.2-3B-Instruct
library_name: transformers
---
```python
import torch
from transformers import pipeline

model_id = "its-magick/Llama-3.2-3b-Ultrachat"
pipe = pipeline(
    "text-generation",
    model=model_id,
    torch_dtype=torch.bfloat16,
    device_map="auto",
)
messages = [
    {"role": "system", "content": "You are a pirate chatbot who always responds in pirate speak!"},
    {"role": "user", "content": "Who are you?"},
]
outputs = pipe(
    messages,
    max_new_tokens=256,
)
print(outputs[0]["generated_text"][-1])
```