tmae commited on
Commit
942662d
·
1 Parent(s): 09a0d0c

Create README.md

Browse files
Files changed (1) hide show
  1. README.md +170 -0
README.md ADDED
@@ -0,0 +1,170 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ language:
4
+ - en
5
+ - ja
6
+ programming_language:
7
+ - C
8
+ - C++
9
+ - C#
10
+ - Go
11
+ - Java
12
+ - JavaScript
13
+ - Lua
14
+ - PHP
15
+ - Python
16
+ - Ruby
17
+ - Rust
18
+ - Scala
19
+ - TypeScript
20
+ library_name: peft
21
+ pipeline_tag: text-generation
22
+ inference: false
23
+ ---
24
+ # llm-jp-13b-instruct-lora-jaster-dolly-oasst-v1.0
25
+
26
+ This model is based on [llm-jp/llm-jp-13b-instruct-lora-jaster-dolly-oasst-v1.0](https://huggingface.co/llm-jp/llm-jp-13b-instruct-lora-jaster-dolly-oasst-v1.0) .
27
+
28
+ This version does not have Tokenizer postprocessing (i.e. adding eos token) so there is no need to specify `add_special_tokens=False` on tokenize.
29
+
30
+ Also lora is already merged.
31
+
32
+ ---
33
+
34
+ This repository provides large language models developed by [LLM-jp](https://llm-jp.nii.ac.jp/), a collaborative project launched in Japan.
35
+
36
+ | Model Variant |
37
+ | :--- |
38
+ |**Instruction models**|
39
+ | [llm-jp-13b-instruct-full-jaster-v1.0](https://huggingface.co/llm-jp/llm-jp-13b-instruct-full-jaster-v1.0) |
40
+ | [llm-jp-13b-instruct-full-jaster-dolly-oasst-v1.0](https://huggingface.co/llm-jp/llm-jp-13b-instruct-full-jaster-dolly-oasst-v1.0) |
41
+ | [llm-jp-13b-instruct-full-dolly-oasst-v1.0](https://huggingface.co/llm-jp/llm-jp-13b-instruct-full-dolly-oasst-v1.0) |
42
+ | [llm-jp-13b-instruct-lora-jaster-v1.0](https://huggingface.co/llm-jp/llm-jp-13b-instruct-lora-jaster-v1.0) |
43
+ | [llm-jp-13b-instruct-lora-jaster-dolly-oasst-v1.0](https://huggingface.co/llm-jp/llm-jp-13b-instruct-lora-jaster-dolly-oasst-v1.0) |
44
+ | [llm-jp-13b-instruct-lora-dolly-oasst-v1.0](https://huggingface.co/llm-jp/llm-jp-13b-instruct-lora-dolly-oasst-v1.0) |
45
+
46
+
47
+ | |
48
+ | :--- |
49
+ |**Pre-trained models**|
50
+ | [llm-jp-13b-v1.0](https://huggingface.co/llm-jp/llm-jp-13b-v1.0) |
51
+ | [llm-jp-1.3b-v1.0](https://huggingface.co/llm-jp/llm-jp-1.3b-v1.0) |
52
+ Checkpoints format: Hugging Face Transformers (Megatron-DeepSpeed format models are available [here](https://huggingface.co/llm-jp/llm-jp-13b-v1.0-mdsfmt))
53
+
54
+
55
+ ## Required Libraries and Their Versions
56
+
57
+ - torch>=2.0.0
58
+ - transformers>=4.34.0
59
+ - tokenizers>=0.14.0
60
+ - accelerate==0.23.0
61
+ - peft==0.5.0
62
+
63
+ ## Usage
64
+
65
+ ```python
66
+ import torch
67
+ from peft import PeftModel, PeftConfig
68
+ from transformers import AutoTokenizer, AutoModelForCausalLM
69
+ peft_model_name = "llm-jp/llm-jp-13b-instruct-lora-jaster-dolly-oasst-v1.0"
70
+ tokenizer = AutoTokenizer.from_pretrained(peft_model_name)
71
+ config = PeftConfig.from_pretrained(peft_model_name)
72
+ model = AutoModelForCausalLM.from_pretrained(config.base_model_name_or_path, device_map="auto", torch_dtype=torch.float16)
73
+ model = PeftModel.from_pretrained(model, peft_model_name)
74
+ text = "自然言語処理とは何か"
75
+ text = text + "### 回答:"
76
+ tokenized_input = tokenizer(text, add_special_tokens=False, return_tensors="pt").to(model.device)
77
+ with torch.no_grad():
78
+ output = model.generate(
79
+ **tokenized_input,
80
+ max_new_tokens=100,
81
+ do_sample=True,
82
+ top_p=0.95,
83
+ temperature=0.7,
84
+ )[0]
85
+ print(tokenizer.decode(output))
86
+ ```
87
+
88
+
89
+ ## Model Details
90
+
91
+ - **Model type:** Transformer-based Language Model
92
+ - **Total seen tokens:** 300B
93
+
94
+ |Model|Params|Layers|Hidden size|Heads|Context length|
95
+ |:---:|:---:|:---:|:---:|:---:|:---:|
96
+ |13b model|13b|40|5120|40|2048|
97
+ |1.3b model|1.3b|24|2048|16|2048|
98
+
99
+
100
+ ## Training
101
+
102
+ - **Pre-training:**
103
+ - **Hardware:** 96 A100 40GB GPUs ([mdx cluster](https://mdx.jp/en/))
104
+ - **Software:** Megatron-DeepSpeed
105
+
106
+ - **Instruction tuning:**
107
+ - **Hardware:** 8 A100 40GB GPUs ([mdx cluster](https://mdx.jp/en/))
108
+ - **Software:** [TRL](https://github.com/huggingface/trl), [PEFT](https://github.com/huggingface/peft), and [DeepSpeed](https://github.com/microsoft/DeepSpeed)
109
+
110
+
111
+ ## Tokenizer
112
+ The tokenizer of this model is based on [huggingface/tokenizers](https://github.com/huggingface/tokenizers) Unigram byte-fallback model.
113
+ The vocabulary entries were converted from [`llm-jp-tokenizer v2.1 (50k)`](https://github.com/llm-jp/llm-jp-tokenizer/releases/tag/v2.1).
114
+ Please refer to [README.md](https://github.com/llm-jp/llm-jp-tokenizer) of `llm-ja-tokenizer` for details on the vocabulary construction procedure.
115
+ - **Model:** Hugging Face Fast Tokenizer using Unigram byte-fallback model which requires `tokenizers>=0.14.0`
116
+ - **Training algorithm:** SentencePiece Unigram byte-fallback
117
+ - **Training data:** A subset of the datasets for model pre-training
118
+ - **Vocabulary size:** 50,570 (mixed vocabulary of Japanese, English, and source code)
119
+
120
+
121
+ ## Datasets
122
+
123
+ ### Pre-training
124
+
125
+ The models have been pre-trained using a blend of the following datasets.
126
+
127
+ | Language | Dataset | Tokens|
128
+ |:---:|:---:|:---:|
129
+ |Japanese|[Wikipedia](https://huggingface.co/datasets/wikipedia)|1.5B
130
+ ||[mC4](https://huggingface.co/datasets/mc4)|136B
131
+ |English|[Wikipedia](https://huggingface.co/datasets/wikipedia)|5B
132
+ ||[The Pile](https://huggingface.co/datasets/EleutherAI/pile)|135B
133
+ |Codes|[The Stack](https://huggingface.co/datasets/bigcode/the-stack)|10B
134
+
135
+ The pre-training was continuously conducted using a total of 10 folds of non-overlapping data, each consisting of approximately 27-28B tokens.
136
+ We finalized the pre-training with additional (potentially) high-quality 27B tokens data obtained from the identical source datasets listed above used for the 10-fold data.
137
+
138
+ ### Instruction tuning
139
+
140
+ The models have been fine-tuned on the following datasets.
141
+
142
+ | Language | Dataset | description |
143
+ |:---|:---:|:---:|
144
+ |Japanese|[jaster](https://github.com/llm-jp/llm-jp-eval)| An automatically transformed data from the existing Japanese NLP datasets |
145
+ ||[databricks-dolly-15k](https://huggingface.co/datasets/databricks/databricks-dolly-15k)| A translated one by DeepL in LLM-jp |
146
+ ||[OpenAssistant Conversations Dataset](https://huggingface.co/datasets/OpenAssistant/oasst1)| A translated one by DeepL in LLM-jp |
147
+
148
+
149
+ ## Evaluation
150
+ You can view the evaluation results of several LLMs on this [leaderboard](http://wandb.me/llm-jp-leaderboard). We used [llm-jp-eval](https://github.com/llm-jp/llm-jp-eval) for the evaluation.
151
+
152
+ ## Risks and Limitations
153
+
154
+ The models released here are still in the early stages of our research and development and have not been tuned to ensure outputs align with human intent and safety considerations.
155
+
156
+
157
+ ## Send Questions to
158
+
159
+ llm-jp(at)nii.ac.jp
160
+
161
+
162
+ ## License
163
+
164
+ [Apache License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0)
165
+
166
+
167
+ ## Model Card Authors
168
+ *The names are listed in alphabetical order.*
169
+
170
+ Hirokazu Kiyomaru, Hiroshi Matsuda, Jun Suzuki, Namgi Han, Saku Sugawara, Shota Sasaki, Shuhei Kurita, Taishi Nakamura, Takumi Okamoto.