Update README.md
Browse files
README.md
CHANGED
@@ -24,10 +24,13 @@ This gemma model was trained 2x faster with [Unsloth](https://github.com/unsloth
|
|
24 |
# Inference With Unsloth on colab
|
25 |
|
26 |
|
27 |
-
|
|
|
|
|
28 |
import torch
|
29 |
major_version, minor_version = torch.cuda.get_device_capability()
|
30 |
-
|
|
|
31 |
!pip install "unsloth[colab-new] @ git+https://github.com/unslothai/unsloth.git"
|
32 |
if major_version >= 8:
|
33 |
# Use this for new GPUs like Ampere, Hopper GPUs (RTX 30xx, RTX 40xx, A100, H100, L40)
|
@@ -72,9 +75,10 @@ input_text = input_prompt.format(
|
|
72 |
inputs = tokenizer([input_text], return_tensors = "pt").to("cuda")
|
73 |
|
74 |
outputs = model.generate(**inputs, max_new_tokens = 300, use_cache = True)
|
75 |
-
response = tokenizer.batch_decode(outputs)
|
76 |
|
|
|
77 |
|
|
|
78 |
|
79 |
|
80 |
|
|
|
24 |
# Inference With Unsloth on colab
|
25 |
|
26 |
|
27 |
+
```python3
|
28 |
+
|
29 |
+
|
30 |
import torch
|
31 |
major_version, minor_version = torch.cuda.get_device_capability()
|
32 |
+
|
33 |
+
|
34 |
!pip install "unsloth[colab-new] @ git+https://github.com/unslothai/unsloth.git"
|
35 |
if major_version >= 8:
|
36 |
# Use this for new GPUs like Ampere, Hopper GPUs (RTX 30xx, RTX 40xx, A100, H100, L40)
|
|
|
75 |
inputs = tokenizer([input_text], return_tensors = "pt").to("cuda")
|
76 |
|
77 |
outputs = model.generate(**inputs, max_new_tokens = 300, use_cache = True)
|
|
|
78 |
|
79 |
+
response = tokenizer.batch_decode(outputs)
|
80 |
|
81 |
+
```
|
82 |
|
83 |
|
84 |
|