Update README.md
Browse files
README.md
CHANGED
@@ -27,4 +27,22 @@ tags:
|
|
27 |
<prompt> (without the <>)
|
28 |
|
29 |
### Response:
|
30 |
-
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
27 |
<prompt> (without the <>)
|
28 |
|
29 |
### Response:
|
30 |
+
```
|
31 |
+
|
32 |
+
## Sample Code
|
33 |
+
|
34 |
+
```python
|
35 |
+
import torch
|
36 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
37 |
+
|
38 |
+
torch.set_default_device("cuda")
|
39 |
+
|
40 |
+
model = AutoModelForCausalLM.from_pretrained("ibivibiv/strix-rufipes-70b", torch_dtype="auto", device_config='auto')
|
41 |
+
tokenizer = AutoTokenizer.from_pretrained("ibivibiv/strix-rufipes-70b", trust_remote_code=True)
|
42 |
+
|
43 |
+
inputs = tokenizer("Create a plan for developing the game of snake in python using pygame.", return_tensors="pt", return_attention_mask=False)
|
44 |
+
|
45 |
+
outputs = model.generate(**inputs, max_length=200)
|
46 |
+
text = tokenizer.batch_decode(outputs)[0]
|
47 |
+
print(text)
|
48 |
+
```
|