Upload 5 files
Browse files- README.md +49 -0
- config.json +31 -0
- model.safetensors +3 -0
- pytorch_model.bin +3 -0
- quantize_config.json +11 -0
README.md
ADDED
@@ -0,0 +1,49 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
license: apache-2.0
|
3 |
+
inference: false
|
4 |
+
language: ja
|
5 |
+
---
|
6 |
+
|
7 |
+
# japanese-large-lm-3.6b-instruction-sft-4bit-32g-actorder_False
|
8 |
+
|
9 |
+
This repository provides a 3.6B parameters Japanese language **quantized** model, fine-tuned and trained by [LINE Corporation](https://linecorp.com/ja/).
|
10 |
+
|
11 |
+
## For Japanese
|
12 |
+
|
13 |
+
詳細な説明や実験に関しては「[【インターンレポート】量子化による大規模言語モデル軽量化の効果測定](https://engineering.linecorp.com/ja/blog/quantization-lightweighting-llms)」をご覧ください。
|
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 = AutoModelForCausalLM.from_pretrained("line-corporation/japanese-large-lm-3.6b-instruction-sft-4bit-32g-actorder_False")
|
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) # [{'generated_text': 'ユーザー: 四国の県名を全て列挙してください。\nシステム: 高知県、徳島県、香川県、愛媛県'}]
|
40 |
+
```
|
41 |
+
|
42 |
+
## Tokenization
|
43 |
+
|
44 |
+
We use a sentencepiece tokenizer with a unigram language model and byte-fallback.
|
45 |
+
We **do not** apply pre-tokenization with Japanese tokenizer.
|
46 |
+
Thus, a user may directly feed raw sentences into the tokenizer.
|
47 |
+
|
48 |
+
## License
|
49 |
+
[Apache License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0)
|
config.json
ADDED
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"_name_or_path": "line-corporation/japanese-large-lm-3.6b-instruction-sft",
|
3 |
+
"architectures": [
|
4 |
+
"GPTNeoXForCausalLM"
|
5 |
+
],
|
6 |
+
"attention_dropout": 0.0,
|
7 |
+
"bos_token_id": 2,
|
8 |
+
"classifier_dropout": 0.1,
|
9 |
+
"end_token_id": 2,
|
10 |
+
"eos_token_id": 2,
|
11 |
+
"hidden_act": "gelu",
|
12 |
+
"hidden_dropout": 0.0,
|
13 |
+
"hidden_size": 3072,
|
14 |
+
"initializer_range": 0.02,
|
15 |
+
"intermediate_size": 12288,
|
16 |
+
"layer_norm_eps": 1e-05,
|
17 |
+
"max_position_embeddings": 2048,
|
18 |
+
"model_type": "gpt_neox",
|
19 |
+
"num_attention_heads": 32,
|
20 |
+
"num_hidden_layers": 30,
|
21 |
+
"pad_token_id": 2,
|
22 |
+
"rope_scaling": null,
|
23 |
+
"rotary_emb_base": 10000,
|
24 |
+
"rotary_pct": 1.0,
|
25 |
+
"tie_word_embeddings": true,
|
26 |
+
"torch_dtype": "float16",
|
27 |
+
"transformers_version": "4.33.0",
|
28 |
+
"use_cache": true,
|
29 |
+
"use_parallel_residual": false,
|
30 |
+
"vocab_size": 51200
|
31 |
+
}
|
model.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:d3ec5ade49159a8d6acd05ffd53d21f4d826690ee4c49ebb339f5d934f62157d
|
3 |
+
size 2598342960
|
pytorch_model.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:b7b5a490050b8f6d5a7122d4e8aabdd30ae520b4e420b273a055ed3527d469ee
|
3 |
+
size 2283957070
|
quantize_config.json
ADDED
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"bits": 4,
|
3 |
+
"group_size": 32,
|
4 |
+
"damp_percent": 0.01,
|
5 |
+
"desc_act": false,
|
6 |
+
"static_groups": false,
|
7 |
+
"sym": true,
|
8 |
+
"true_sequential": true,
|
9 |
+
"model_name_or_path": "quantized/line-corporation/japanese-large-lm-3.6b-instruction-sft/gptq-4bit-32g-actorder_False",
|
10 |
+
"model_file_base_name": "gptq_model-4bit-32g"
|
11 |
+
}
|