omitakahiro
commited on
Commit
•
9035053
1
Parent(s):
cc68652
Update README.md
Browse files
README.md
CHANGED
@@ -19,22 +19,10 @@ 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 AutoTokenizer
|
23 |
-
from peft import AutoPeftModelForCausalLM
|
24 |
|
25 |
tokenizer = AutoTokenizer.from_pretrained("stockmark/stockmark-100b")
|
26 |
-
model =
|
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():
|
|
|
19 |
|
20 |
```python
|
21 |
import torch
|
22 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
|
|
23 |
|
24 |
tokenizer = AutoTokenizer.from_pretrained("stockmark/stockmark-100b")
|
25 |
+
model = AutoModelForCausalLM.from_pretrained("stockmark/stockmark-100b", device_map="auto", torch_dtype=torch.bfloat16)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
26 |
|
27 |
input_ids = tokenizer("生成AIとは?", return_tensors="pt").input_ids.to(model.device)
|
28 |
with torch.inference_mode():
|