kajyuuen
commited on
Commit
•
14bd5e4
0
Parent(s):
Init commit
Browse files- .gitattributes +34 -0
- README.md +50 -0
- config.json +28 -0
- pytorch_model.bin +3 -0
- special_tokens_map.json +9 -0
- spiece.model +3 -0
- tokenizer_config.json +17 -0
.gitattributes
ADDED
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
*.7z filter=lfs diff=lfs merge=lfs -text
|
2 |
+
*.arrow filter=lfs diff=lfs merge=lfs -text
|
3 |
+
*.bin filter=lfs diff=lfs merge=lfs -text
|
4 |
+
*.bz2 filter=lfs diff=lfs merge=lfs -text
|
5 |
+
*.ckpt filter=lfs diff=lfs merge=lfs -text
|
6 |
+
*.ftz filter=lfs diff=lfs merge=lfs -text
|
7 |
+
*.gz filter=lfs diff=lfs merge=lfs -text
|
8 |
+
*.h5 filter=lfs diff=lfs merge=lfs -text
|
9 |
+
*.joblib filter=lfs diff=lfs merge=lfs -text
|
10 |
+
*.lfs.* filter=lfs diff=lfs merge=lfs -text
|
11 |
+
*.mlmodel filter=lfs diff=lfs merge=lfs -text
|
12 |
+
*.model filter=lfs diff=lfs merge=lfs -text
|
13 |
+
*.msgpack filter=lfs diff=lfs merge=lfs -text
|
14 |
+
*.npy filter=lfs diff=lfs merge=lfs -text
|
15 |
+
*.npz filter=lfs diff=lfs merge=lfs -text
|
16 |
+
*.onnx filter=lfs diff=lfs merge=lfs -text
|
17 |
+
*.ot filter=lfs diff=lfs merge=lfs -text
|
18 |
+
*.parquet filter=lfs diff=lfs merge=lfs -text
|
19 |
+
*.pb filter=lfs diff=lfs merge=lfs -text
|
20 |
+
*.pickle filter=lfs diff=lfs merge=lfs -text
|
21 |
+
*.pkl filter=lfs diff=lfs merge=lfs -text
|
22 |
+
*.pt filter=lfs diff=lfs merge=lfs -text
|
23 |
+
*.pth filter=lfs diff=lfs merge=lfs -text
|
24 |
+
*.rar filter=lfs diff=lfs merge=lfs -text
|
25 |
+
*.safetensors filter=lfs diff=lfs merge=lfs -text
|
26 |
+
saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
27 |
+
*.tar.* filter=lfs diff=lfs merge=lfs -text
|
28 |
+
*.tflite filter=lfs diff=lfs merge=lfs -text
|
29 |
+
*.tgz filter=lfs diff=lfs merge=lfs -text
|
30 |
+
*.wasm filter=lfs diff=lfs merge=lfs -text
|
31 |
+
*.xz filter=lfs diff=lfs merge=lfs -text
|
32 |
+
*.zip filter=lfs diff=lfs merge=lfs -text
|
33 |
+
*.zst filter=lfs diff=lfs merge=lfs -text
|
34 |
+
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
README.md
ADDED
@@ -0,0 +1,50 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
license: apache-2.0
|
3 |
+
inference: false
|
4 |
+
language: ja
|
5 |
+
---
|
6 |
+
|
7 |
+
# japanese-large-lm-3.6b-instruction-sft
|
8 |
+
|
9 |
+
This repository provides a 3.6B parameters Japanese language model, fine-tuned and trained by [LINE Corporation](https://linecorp.com/ja/).
|
10 |
+
|
11 |
+
## For Japanese
|
12 |
+
|
13 |
+
詳細な説明や実験に関しては「[Instruction Tuningにより対話性能を向上させた3.6B日本語言語モデルを公開します](https://engineering.linecorp.com/ja/blog/3.6b-japanese-language-model-with-improved-dialog-performance-by-instruction-tuning)」をご覧ください。
|
14 |
+
|
15 |
+
## How to use
|
16 |
+
|
17 |
+
```python
|
18 |
+
import torch
|
19 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer, pipeline
|
20 |
+
|
21 |
+
tokenizer = AutoTokenizer.from_pretrained("line-corporation/japanese-large-lm-3.6b-instruction-sft", use_fast=False)
|
22 |
+
model = AutoModel.from_pretrained("line-corporation/japanese-large-lm-3.6b-instruction-sft")
|
23 |
+
|
24 |
+
generator = pipeline("text-generation", model=model, tokenizer=tokenizer, device=0)
|
25 |
+
|
26 |
+
input_text = """四国の県名を全て列挙してください。"""
|
27 |
+
text = generator(
|
28 |
+
f"ユーザー: {input_text}\nシステム: ",
|
29 |
+
max_length = 256,
|
30 |
+
do_sample = True,
|
31 |
+
temperature = 0.7,
|
32 |
+
top_p = 0.9,
|
33 |
+
top_k = 0,
|
34 |
+
repetition_penalty = 1.1,
|
35 |
+
num_beams = 1,
|
36 |
+
pad_token_id = tokenizer.pad_token_id,
|
37 |
+
num_return_sequences = 1,
|
38 |
+
)
|
39 |
+
print(text)
|
40 |
+
# [{'generated_text': 'ユーザー: 四国の県名を全て列挙してください。\nシステム: 高知県、徳島県、香川県、愛媛県'}]
|
41 |
+
```
|
42 |
+
|
43 |
+
## Tokenization
|
44 |
+
|
45 |
+
We use a sentencepiece tokenizer with a unigram language model and byte-fallback.
|
46 |
+
We **do not** apply pre-tokenization with Japanese tokenizer.
|
47 |
+
Thus, a user may directly feed raw sentences into the tokenizer.
|
48 |
+
|
49 |
+
## License
|
50 |
+
[Apache License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0)
|
config.json
ADDED
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"_name_or_path": "/vsfs/deepspeed_chat/base-models/line-gpt-japanese-3.6b",
|
3 |
+
"architectures": [
|
4 |
+
"GPTNeoXForCausalLM"
|
5 |
+
],
|
6 |
+
"bos_token_id": 2,
|
7 |
+
"classifier_dropout": 0.1,
|
8 |
+
"end_token_id": 2,
|
9 |
+
"eos_token_id": 2,
|
10 |
+
"hidden_act": "gelu",
|
11 |
+
"hidden_size": 3072,
|
12 |
+
"initializer_range": 0.02,
|
13 |
+
"intermediate_size": 12288,
|
14 |
+
"layer_norm_eps": 1e-05,
|
15 |
+
"max_position_embeddings": 2048,
|
16 |
+
"model_type": "gpt_neox",
|
17 |
+
"num_attention_heads": 32,
|
18 |
+
"num_hidden_layers": 30,
|
19 |
+
"pad_token_id": 2,
|
20 |
+
"rotary_emb_base": 10000,
|
21 |
+
"rotary_pct": 1.0,
|
22 |
+
"tie_word_embeddings": true,
|
23 |
+
"torch_dtype": "float16",
|
24 |
+
"transformers_version": "4.31.0.dev0",
|
25 |
+
"use_cache": true,
|
26 |
+
"use_parallel_residual": false,
|
27 |
+
"vocab_size": 51200
|
28 |
+
}
|
pytorch_model.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:ab959c05b8f03351ead7aa0f36ca5e5f5b6eff47f2c948af3724143a2884594e
|
3 |
+
size 7237685489
|
special_tokens_map.json
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"bos_token": "<s>",
|
3 |
+
"cls_token": "<cls>",
|
4 |
+
"eos_token": "</s>",
|
5 |
+
"mask_token": "<mask>",
|
6 |
+
"pad_token": "</s>",
|
7 |
+
"sep_token": "<sep>",
|
8 |
+
"unk_token": "<unk>"
|
9 |
+
}
|
spiece.model
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:0c5c56a739832923347681ed8a03a9cbf5afb6d1fe60089a5b01dd2dd063ab71
|
3 |
+
size 1208648
|
tokenizer_config.json
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"additional_special_tokens": null,
|
3 |
+
"bos_token": "<s>",
|
4 |
+
"clean_up_tokenization_spaces": true,
|
5 |
+
"cls_token": "<cls>",
|
6 |
+
"do_lower_case": false,
|
7 |
+
"eos_token": "</s>",
|
8 |
+
"extra_ids": 0,
|
9 |
+
"keep_accents": true,
|
10 |
+
"mask_token": "<mask>",
|
11 |
+
"model_max_length": 1000000000000000019884624838656,
|
12 |
+
"pad_token": "<pad>",
|
13 |
+
"sep_token": "<sep>",
|
14 |
+
"sp_model_kwargs": {},
|
15 |
+
"tokenizer_class": "T5Tokenizer",
|
16 |
+
"unk_token": "<unk>"
|
17 |
+
}
|