Xhaheen commited on
Commit
457334e
·
verified ·
1 Parent(s): aeb4b57

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +7 -3
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
- %%capture
 
 
28
  import torch
29
  major_version, minor_version = torch.cuda.get_device_capability()
30
- # Must install separately since Colab has torch 2.2.1, which breaks packages
 
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