omitakahiro
commited on
Commit
•
a1660f4
1
Parent(s):
5294e31
Update README.md
Browse files
README.md
CHANGED
@@ -23,7 +23,13 @@ This project is supported by [AWS LLM development support program](https://aws.a
|
|
23 |
import torch
|
24 |
from transformers import AutoModelForCausalLM, AutoTokenizer
|
25 |
|
|
|
26 |
model = AutoModelForCausalLM.from_pretrained("stockmark/stockmark-13b", device_map="auto", torch_dtype=torch.bfloat16)
|
|
|
|
|
|
|
|
|
|
|
27 |
tokenizer = AutoTokenizer.from_pretrained("stockmark/stockmark-13b")
|
28 |
|
29 |
inputs = tokenizer("自然言語処理とは", return_tensors="pt").to(model.device)
|
@@ -39,9 +45,10 @@ output = tokenizer.decode(tokens[0], skip_special_tokens=True)
|
|
39 |
print(output)
|
40 |
```
|
41 |
|
42 |
-
##
|
43 |
|
44 |
-
- LoRA tuning
|
|
|
45 |
|
46 |
## Training dataset
|
47 |
|
|
|
23 |
import torch
|
24 |
from transformers import AutoModelForCausalLM, AutoTokenizer
|
25 |
|
26 |
+
# For A100 or H100 GPU
|
27 |
model = AutoModelForCausalLM.from_pretrained("stockmark/stockmark-13b", device_map="auto", torch_dtype=torch.bfloat16)
|
28 |
+
|
29 |
+
# If you use a T4 or V100 GPU, please load a model in 8 bit with the below code.
|
30 |
+
# To do so, you need to install `bitsandbytes` via `pip install bitsandbytes`.
|
31 |
+
# model = AutoModelForCausalLM.from_pretrained("stockmark/stockmark-13b", device_map={"": 0}, load_in_8bit=True)
|
32 |
+
|
33 |
tokenizer = AutoTokenizer.from_pretrained("stockmark/stockmark-13b")
|
34 |
|
35 |
inputs = tokenizer("自然言語処理とは", return_tensors="pt").to(model.device)
|
|
|
45 |
print(output)
|
46 |
```
|
47 |
|
48 |
+
## Examples:
|
49 |
|
50 |
+
- LoRA tuning: https://huggingface.co/stockmark/stockmark-13b/blob/main/notebooks/LoRA.ipynb
|
51 |
+
- QLoRA tuning (in preparation): https://huggingface.co/stockmark/stockmark-13b/blob/main/notebooks/QLoRA.ipynb
|
52 |
|
53 |
## Training dataset
|
54 |
|