TitanML Co commited on
Commit
cbe9768
1 Parent(s): e0bfb1a

Upload folder using huggingface_hub

Browse files
.gitattributes CHANGED
@@ -25,7 +25,6 @@
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
- *.tar filter=lfs diff=lfs merge=lfs -text
29
  *.tflite filter=lfs diff=lfs merge=lfs -text
30
  *.tgz filter=lfs diff=lfs merge=lfs -text
31
  *.wasm 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
README.md ADDED
@@ -0,0 +1,213 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ language:
4
+ - en
5
+ datasets:
6
+ - togethercomputer/RedPajama-Data-1T
7
+ ---
8
+
9
+ # RedPajama-INCITE-7B-Base
10
+
11
+ RedPajama-INCITE-7B-Base was developed by Together and leaders from the open-source AI community including Ontocord.ai, ETH DS3Lab, AAI CERC, Université de Montréal, MILA - Québec AI Institute, Stanford Center for Research on Foundation Models (CRFM), Stanford Hazy Research research group and LAION.
12
+ The training was done on 3,072 V100 GPUs provided as part of the INCITE 2023 project on Scalable Foundation Models for Transferrable Generalist AI, awarded to MILA, LAION, and EleutherAI in fall 2022, with support from the Oak Ridge Leadership Computing Facility (OLCF) and INCITE program.
13
+
14
+ - Base Model: [RedPajama-INCITE-7B-Base](https://huggingface.co/togethercomputer/RedPajama-INCITE-7B-Base)
15
+ - Instruction-tuned Version: [RedPajama-INCITE-7B-Instruct](https://huggingface.co/togethercomputer/RedPajama-INCITE-7B-Instruct)
16
+ - Chat Version: [RedPajama-INCITE-7B-Chat](https://huggingface.co/togethercomputer/RedPajama-INCITE-7B-Chat)
17
+
18
+
19
+ ## Model Details
20
+ - **Developed by**: Together Computer.
21
+ - **Model type**: Language Model
22
+ - **Language(s)**: English
23
+ - **License**: Apache 2.0
24
+ - **Model Description**: A 6.9B parameter pretrained language model.
25
+
26
+ # Quick Start
27
+
28
+ Please note that the model requires `transformers` version >= 4.25.1.
29
+
30
+ ## GPU Inference
31
+
32
+ This requires a GPU with 16GB memory.
33
+
34
+ ```python
35
+ import torch
36
+ import transformers
37
+ from transformers import AutoTokenizer, AutoModelForCausalLM
38
+
39
+ MIN_TRANSFORMERS_VERSION = '4.25.1'
40
+
41
+ # check transformers version
42
+ assert transformers.__version__ >= MIN_TRANSFORMERS_VERSION, f'Please upgrade transformers to version {MIN_TRANSFORMERS_VERSION} or higher.'
43
+
44
+ # init
45
+ tokenizer = AutoTokenizer.from_pretrained("togethercomputer/RedPajama-INCITE-7B-Base")
46
+ model = AutoModelForCausalLM.from_pretrained("togethercomputer/RedPajama-INCITE-7B-Base", torch_dtype=torch.float16)
47
+ model = model.to('cuda:0')
48
+ # infer
49
+ prompt = "Alan Turing is"
50
+ inputs = tokenizer(prompt, return_tensors='pt').to(model.device)
51
+ input_length = inputs.input_ids.shape[1]
52
+ outputs = model.generate(
53
+ **inputs, max_new_tokens=128, do_sample=True, temperature=0.7, top_p=0.7, top_k=50, return_dict_in_generate=True
54
+ )
55
+ token = outputs.sequences[0, input_length:]
56
+ output_str = tokenizer.decode(token)
57
+ print(output_str)
58
+ """
59
+ widely considered to be the father of modern computer science and artificial intelligence. He was a brilliant mathematician and cryptographer, who worked for the British government during World War II. He was instrumental in breaking the German Enigma code, and is credited with helping to shorten the war by two years...
60
+ """
61
+ ```
62
+
63
+ ## GPU Inference in Int8
64
+
65
+ This requires a GPU with 12GB memory.
66
+
67
+ To run inference with int8, please ensure you have installed accelerate and bitandbytes. You can install them with the following command:
68
+
69
+ ```bash
70
+ pip install accelerate
71
+ pip install bitsandbytes
72
+ ```
73
+
74
+ Then you can run inference with int8 as follows:
75
+
76
+ ```python
77
+ import torch
78
+ import transformers
79
+ from transformers import AutoTokenizer, AutoModelForCausalLM
80
+
81
+ MIN_TRANSFORMERS_VERSION = '4.25.1'
82
+
83
+ # check transformers version
84
+ assert transformers.__version__ >= MIN_TRANSFORMERS_VERSION, f'Please upgrade transformers to version {MIN_TRANSFORMERS_VERSION} or higher.'
85
+
86
+ # init
87
+ tokenizer = AutoTokenizer.from_pretrained("togethercomputer/RedPajama-INCITE-7B-Base")
88
+ model = AutoModelForCausalLM.from_pretrained("togethercomputer/RedPajama-INCITE-7B-Base", device_map='auto', torch_dtype=torch.float16, load_in_8bit=True)
89
+
90
+ # infer
91
+ prompt = "Alan Turing is"
92
+ inputs = tokenizer(prompt, return_tensors='pt').to(model.device)
93
+ input_length = inputs.input_ids.shape[1]
94
+ outputs = model.generate(
95
+ **inputs, max_new_tokens=128, do_sample=True, temperature=0.7, top_p=0.7, top_k=50, return_dict_in_generate=True
96
+ )
97
+ token = outputs.sequences[0, input_length:]
98
+ output_str = tokenizer.decode(token)
99
+ print(output_str)
100
+ """
101
+ a very well-known name in the world of computer science. It is named after the mathematician Alan Turing. He is famous for his work on the Enigma machine, which was used by the Germans during World War II....
102
+ """```
103
+
104
+ ## CPU Inference
105
+
106
+ ```python
107
+ import torch
108
+ import transformers
109
+ from transformers import AutoTokenizer, AutoModelForCausalLM
110
+
111
+ MIN_TRANSFORMERS_VERSION = '4.25.1'
112
+
113
+ # check transformers version
114
+ assert transformers.__version__ >= MIN_TRANSFORMERS_VERSION, f'Please upgrade transformers to version {MIN_TRANSFORMERS_VERSION} or higher.'
115
+
116
+ # init
117
+ tokenizer = AutoTokenizer.from_pretrained("togethercomputer/RedPajama-INCITE-7B-Base")
118
+ model = AutoModelForCausalLM.from_pretrained("togethercomputer/RedPajama-INCITE-7B-Base", torch_dtype=torch.bfloat16)
119
+ # infer
120
+ prompt = "Alan Turing is"
121
+ inputs = tokenizer(prompt, return_tensors='pt').to(model.device)
122
+ input_length = inputs.input_ids.shape[1]
123
+ outputs = model.generate(
124
+ **inputs, max_new_tokens=128, do_sample=True, temperature=0.7, top_p=0.7, top_k=50, return_dict_in_generate=True
125
+ )
126
+ token = outputs.sequences[0, input_length:]
127
+ output_str = tokenizer.decode(token)
128
+ print(output_str)
129
+ """
130
+ one of the most important figures in the history of computing. He is best known for his work on the development of the modern computer and for his code-breaking work during World War II. He was also a brilliant mathematician and philosopher.
131
+ """
132
+ ```
133
+
134
+ Please note that since `LayerNormKernelImpl` is not implemented in fp16 for CPU, we use `bfloat16` for CPU inference.
135
+
136
+ # Uses
137
+
138
+ ## Direct Use
139
+
140
+ Excluded uses are described below.
141
+
142
+ ### Misuse, Malicious Use, and Out-of-Scope Use
143
+
144
+ It is the responsibility of the end user to ensure that the model is used in a responsible and ethical manner.
145
+
146
+ #### Out-of-Scope Use
147
+
148
+ `RedPajama-INCITE-7B-Base` is a language model and may not perform well for other use cases outside of its intended scope.
149
+ For example, it may not be suitable for use in safety-critical applications or for making decisions that have a significant impact on individuals or society.
150
+ It is important to consider the limitations of the model and to only use it for its intended purpose.
151
+
152
+ #### Misuse and Malicious Use
153
+
154
+ `RedPajama-INCITE-7B-Base` is designed for language modeling.
155
+ Misuse of the model, such as using it to engage in illegal or unethical activities, is strictly prohibited and goes against the principles of the project.
156
+
157
+ Using the model to generate content that is cruel to individuals is a misuse of this model. This includes, but is not limited to:
158
+
159
+ - Generating fake news, misinformation, or propaganda
160
+ - Promoting hate speech, discrimination, or violence against individuals or groups
161
+ - Impersonating individuals or organizations without their consent
162
+ - Engaging in cyberbullying or harassment
163
+ - Defamatory content
164
+ - Spamming or scamming
165
+ - Sharing confidential or sensitive information without proper authorization
166
+ - Violating the terms of use of the model or the data used to train it
167
+ - Creating automated bots for malicious purposes such as spreading malware, phishing scams, or spamming
168
+
169
+ ## Limitations
170
+
171
+ `RedPajama-INCITE-7B-Base`, like other language models, has limitations that should be taken into consideration.
172
+ For example, the model may not always provide accurate or relevant answers, particularly for questions that are complex, ambiguous, or outside of its training data.
173
+ We therefore welcome contributions from individuals and organizations, and encourage collaboration towards creating a more robust and inclusive chatbot.
174
+
175
+ ## Training
176
+
177
+ **Training Data**
178
+
179
+ Please refer to [togethercomputer/RedPajama-Data-1T](https://huggingface.co/datasets/togethercomputer/RedPajama-Data-1T)
180
+
181
+ **Training Procedure**
182
+
183
+ - **Hardware:** 512 nodes of 6xV100 (IBM Power9), on the OLCF Summit cluster
184
+ - **Optimizer:** Apex FusedAdam
185
+ - **Parallelism:** Pipeline parallel 12, tensor parallel 2
186
+ - **Gradient Accumulations**: 8 (global batch size 4M tokens)
187
+ - **Num of Tokens:** 1.001T Tokens
188
+ - **Learning rate:** 0.00012
189
+
190
+ ## Benchmark
191
+
192
+ Please refer to our [blog post](https://together.xyz) for benchmark results.
193
+
194
+ ## Intermediate Checkpoints
195
+
196
+ We provide 11 intermediate checkpoints that have been released for study.
197
+ The checkpoints are organized based on the number of tokens they contain, ranging from 240 billion tokens to 1 trillion tokens.
198
+
199
+ - [240b_tokens](https://huggingface.co/togethercomputer/RedPajama-INCITE-7B-Base/tree/240b_tokens)
200
+ - [280b_tokens](https://huggingface.co/togethercomputer/RedPajama-INCITE-7B-Base/tree/280b_tokens)
201
+ - [400b_tokens](https://huggingface.co/togethercomputer/RedPajama-INCITE-7B-Base/tree/400b_tokens)
202
+ - [440b_tokens](https://huggingface.co/togethercomputer/RedPajama-INCITE-7B-Base/tree/440b_tokens)
203
+ - [500b_tokens](https://huggingface.co/togethercomputer/RedPajama-INCITE-7B-Base/tree/500b_tokens)
204
+ - [600b_tokens](https://huggingface.co/togethercomputer/RedPajama-INCITE-7B-Base/tree/600b_tokens)
205
+ - [700b_tokens](https://huggingface.co/togethercomputer/RedPajama-INCITE-7B-Base/tree/700b_tokens)
206
+ - [720b_tokens](https://huggingface.co/togethercomputer/RedPajama-INCITE-7B-Base/tree/720b_tokens)
207
+ - [960b_tokens](https://huggingface.co/togethercomputer/RedPajama-INCITE-7B-Base/tree/960b_tokens)
208
+ - [1t_tokens](https://huggingface.co/togethercomputer/RedPajama-INCITE-7B-Base/tree/1t_tokens)
209
+ - [latest](https://huggingface.co/togethercomputer/RedPajama-INCITE-7B-Base/tree/main)
210
+
211
+ ## Community
212
+
213
+ Join us on [Together Discord](https://discord.gg/6ZVDU8tTD4)
config.json ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_name_or_path": "rp_800b",
3
+ "architectures": [
4
+ "GPTNeoXForCausalLM"
5
+ ],
6
+ "bos_token_id": 0,
7
+ "eos_token_id": 0,
8
+ "hidden_act": "gelu",
9
+ "hidden_size": 4096,
10
+ "initializer_range": 0.02,
11
+ "intermediate_size": 16384,
12
+ "layer_norm_eps": 1e-05,
13
+ "max_position_embeddings": 2048,
14
+ "model_type": "gpt_neox",
15
+ "num_attention_heads": 32,
16
+ "num_hidden_layers": 32,
17
+ "rotary_emb_base": 10000,
18
+ "rotary_pct": 1.0,
19
+ "tie_word_embeddings": false,
20
+ "torch_dtype": "float16",
21
+ "transformers_version": "4.28.1",
22
+ "use_cache": true,
23
+ "use_parallel_residual": false,
24
+ "vocab_size": 50432
25
+ }
ct_output_models/config.json ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ {
2
+ "bos_token": "<|endoftext|>",
3
+ "eos_token": "<|endoftext|>",
4
+ "layer_norm_epsilon": null,
5
+ "unk_token": "<|endoftext|>"
6
+ }
ct_output_models/model.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0090085629526015a633a79dc761c204cf6f1aab40c8f05c45d02bae6bdf530e
3
+ size 6867593490
ct_output_models/vocabulary.json ADDED
The diff for this file is too large to render. See raw diff
 
generation_config.json ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ {
2
+ "_from_model_config": true,
3
+ "bos_token_id": 0,
4
+ "eos_token_id": 0,
5
+ "transformers_version": "4.28.1"
6
+ }
special_tokens_map.json ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ {
2
+ "bos_token": "<|endoftext|>",
3
+ "eos_token": "<|endoftext|>",
4
+ "unk_token": "<|endoftext|>"
5
+ }
tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
tokenizer_config.json ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "add_prefix_space": false,
3
+ "bos_token": "<|endoftext|>",
4
+ "clean_up_tokenization_spaces": true,
5
+ "eos_token": "<|endoftext|>",
6
+ "model_max_length": 2048,
7
+ "tokenizer_class": "GPTNeoXTokenizer",
8
+ "unk_token": "<|endoftext|>"
9
+ }