Create README.md
Browse files
README.md
ADDED
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
license: apache-2.0
|
3 |
+
language:
|
4 |
+
- sw
|
5 |
+
- en
|
6 |
+
---
|
7 |
+
|
8 |
+
```python
|
9 |
+
# pip install accelerate
|
10 |
+
from transformers import AutoTokenizer, AutoModelForCausalLM
|
11 |
+
import torch
|
12 |
+
|
13 |
+
tokenizer = AutoTokenizer.from_pretrained("sartifyllc/sartify_gemma2-2B-16bit")
|
14 |
+
model = AutoModelForCausalLM.from_pretrained(
|
15 |
+
"sartifyllc/sartify_gemma2-2B-16bit",
|
16 |
+
device_map="auto",
|
17 |
+
torch_dtype=torch.bfloat16
|
18 |
+
)
|
19 |
+
|
20 |
+
input_text = "Je moja jumlisha moja ni ngapi?"
|
21 |
+
input_ids = tokenizer(input_text, return_tensors="pt").to("cuda")
|
22 |
+
|
23 |
+
outputs = model.generate(**input_ids)
|
24 |
+
print(tokenizer.decode(outputs[0]))
|
25 |
+
```
|