Update README.md
Browse files
README.md
CHANGED
@@ -4,7 +4,7 @@ datasets:
|
|
4 |
- tatsu-lab/alpaca
|
5 |
---
|
6 |
|
7 |
-
This repo contains a low-rank adapter for LLaMA-
|
8 |
|
9 |
### How to use (8-bit)
|
10 |
|
@@ -13,17 +13,14 @@ import torch
|
|
13 |
from peft import PeftModel
|
14 |
from transformers import LlamaTokenizer, LlamaForCausalLM, GenerationConfig
|
15 |
|
16 |
-
tokenizer =
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
)
|
23 |
-
model = PeftModel.from_pretrained(
|
24 |
-
model, "baruga/alpaca-lora-13b",
|
25 |
-
torch_dtype=torch.float16
|
26 |
)
|
27 |
-
```
|
28 |
|
29 |
-
|
|
|
|
|
|
4 |
- tatsu-lab/alpaca
|
5 |
---
|
6 |
|
7 |
+
This repo contains a low-rank adapter for LLaMA-7b fit on the Stanford Alpaca dataset translated to Polish language.
|
8 |
|
9 |
### How to use (8-bit)
|
10 |
|
|
|
13 |
from peft import PeftModel
|
14 |
from transformers import LlamaTokenizer, LlamaForCausalLM, GenerationConfig
|
15 |
|
16 |
+
tokenizer = LLaMATokenizer.from_pretrained("decapoda-research/llama-13b-hf")
|
17 |
+
|
18 |
+
model = LLaMAForCausalLM.from_pretrained(
|
19 |
+
"decapoda-research/llama-13b-hf",
|
20 |
+
load_in_8bit=True,
|
21 |
+
device_map="auto",
|
|
|
|
|
|
|
|
|
22 |
)
|
|
|
23 |
|
24 |
+
|
25 |
+
model = PeftModel.from_pretrained(model, "lora-alpaca-pl4-13")
|
26 |
+
```
|