Update README.md
Browse files
README.md
CHANGED
@@ -4,7 +4,19 @@ library_name: peft
|
|
4 |
---
|
5 |
How to use :
|
6 |
```python
|
|
|
|
|
|
|
|
|
7 |
!pip install "unsloth[colab-new] @ git+https://github.com/unslothai/unsloth.git"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8 |
import torch
|
9 |
from transformers import TextStreamer
|
10 |
from unsloth import FastLanguageModel
|
|
|
4 |
---
|
5 |
How to use :
|
6 |
```python
|
7 |
+
%%capture
|
8 |
+
import torch
|
9 |
+
major_version, minor_version = torch.cuda.get_device_capability()
|
10 |
+
# Must install separately since Colab has torch 2.2.1, which breaks packages
|
11 |
!pip install "unsloth[colab-new] @ git+https://github.com/unslothai/unsloth.git"
|
12 |
+
if major_version >= 8:
|
13 |
+
# Use this for new GPUs like Ampere, Hopper GPUs (RTX 30xx, RTX 40xx, A100, H100, L40)
|
14 |
+
!pip install --no-deps packaging ninja einops flash-attn xformers trl peft accelerate bitsandbytes
|
15 |
+
else:
|
16 |
+
# Use this for older GPUs (V100, Tesla T4, RTX 20xx)
|
17 |
+
!pip install --no-deps xformers trl peft accelerate bitsandbytes
|
18 |
+
pass
|
19 |
+
|
20 |
import torch
|
21 |
from transformers import TextStreamer
|
22 |
from unsloth import FastLanguageModel
|