omitakahiro
commited on
Commit
•
cc68652
1
Parent(s):
0679612
Update README.md
Browse files
README.md
CHANGED
@@ -19,10 +19,22 @@ This project is supported by [GENIAC](https://www.meti.go.jp/policy/mono_info_se
|
|
19 |
|
20 |
```python
|
21 |
import torch
|
22 |
-
from transformers import
|
|
|
23 |
|
24 |
tokenizer = AutoTokenizer.from_pretrained("stockmark/stockmark-100b")
|
25 |
-
model =
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
26 |
|
27 |
input_ids = tokenizer("生成AIとは?", return_tensors="pt").input_ids.to(model.device)
|
28 |
with torch.inference_mode():
|
|
|
19 |
|
20 |
```python
|
21 |
import torch
|
22 |
+
from transformers import AutoTokenizer
|
23 |
+
from peft import AutoPeftModelForCausalLM
|
24 |
|
25 |
tokenizer = AutoTokenizer.from_pretrained("stockmark/stockmark-100b")
|
26 |
+
model = AutoPeftModelForCausalLM.from_pretrained("stockmark/stockmark-100b", device_map="auto", torch_dtype=torch.bfloat16)
|
27 |
+
|
28 |
+
prompt_template = """### 指示:
|
29 |
+
{instruction}
|
30 |
+
|
31 |
+
### 応答:
|
32 |
+
"""
|
33 |
+
|
34 |
+
tokenizer = AutoTokenizer.from_pretrained("stockmark/stockmark-100b-instruct-v0.1")
|
35 |
+
model = AutoPeftModelForCausalLM.from_pretrained("stockmark/stockmark-100b-instruct-v0.1", device_map="auto", torch_dtype=torch.bfloat16)
|
36 |
+
#
|
37 |
+
#
|
38 |
|
39 |
input_ids = tokenizer("生成AIとは?", return_tensors="pt").input_ids.to(model.device)
|
40 |
with torch.inference_mode():
|