Kukedlc commited on
Commit
c9cbd0c
1 Parent(s): 722311d

Upload folder using huggingface_hub

Browse files
README.md ADDED
@@ -0,0 +1,125 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ base_model:
3
+ - openai-community/gpt2
4
+ - openai-community/gpt2
5
+ - openai-community/gpt2
6
+ - openai-community/gpt2
7
+ - openai-community/gpt2
8
+ - openai-community/gpt2
9
+ - openai-community/gpt2
10
+ - openai-community/gpt2
11
+ - openai-community/gpt2
12
+ - openai-community/gpt2
13
+ - openai-community/gpt2
14
+ - openai-community/gpt2
15
+ - openai-community/gpt2
16
+ - openai-community/gpt2
17
+ - openai-community/gpt2
18
+ - openai-community/gpt2
19
+ tags:
20
+ - merge
21
+ - mergekit
22
+ - lazymergekit
23
+ - openai-community/gpt2
24
+ ---
25
+
26
+ # GPT2-EXperiment-2
27
+
28
+ GPT2-EXperiment-2 is a merge of the following models using [LazyMergekit](https://colab.research.google.com/drive/1obulZ1ROXHjYLn6PPZJwRR6GzgQogxxb?usp=sharing):
29
+ * [openai-community/gpt2](https://huggingface.co/openai-community/gpt2)
30
+ * [openai-community/gpt2](https://huggingface.co/openai-community/gpt2)
31
+ * [openai-community/gpt2](https://huggingface.co/openai-community/gpt2)
32
+ * [openai-community/gpt2](https://huggingface.co/openai-community/gpt2)
33
+ * [openai-community/gpt2](https://huggingface.co/openai-community/gpt2)
34
+ * [openai-community/gpt2](https://huggingface.co/openai-community/gpt2)
35
+ * [openai-community/gpt2](https://huggingface.co/openai-community/gpt2)
36
+ * [openai-community/gpt2](https://huggingface.co/openai-community/gpt2)
37
+ * [openai-community/gpt2](https://huggingface.co/openai-community/gpt2)
38
+ * [openai-community/gpt2](https://huggingface.co/openai-community/gpt2)
39
+ * [openai-community/gpt2](https://huggingface.co/openai-community/gpt2)
40
+ * [openai-community/gpt2](https://huggingface.co/openai-community/gpt2)
41
+ * [openai-community/gpt2](https://huggingface.co/openai-community/gpt2)
42
+ * [openai-community/gpt2](https://huggingface.co/openai-community/gpt2)
43
+ * [openai-community/gpt2](https://huggingface.co/openai-community/gpt2)
44
+ * [openai-community/gpt2](https://huggingface.co/openai-community/gpt2)
45
+
46
+ ## 🧩 Configuration
47
+
48
+ ```yaml
49
+ slices:
50
+ - sources:
51
+ - layer_range: [0, 3]
52
+ model: openai-community/gpt2
53
+ - sources:
54
+ - layer_range: [0, 11]
55
+ model: openai-community/gpt2
56
+ - sources:
57
+ - layer_range: [0, 11]
58
+ model: openai-community/gpt2
59
+ - sources:
60
+ - layer_range: [0, 11]
61
+ model: openai-community/gpt2
62
+ - sources:
63
+ - layer_range: [0, 11]
64
+ model: openai-community/gpt2
65
+ - sources:
66
+ - layer_range: [0, 11]
67
+ model: openai-community/gpt2
68
+ - sources:
69
+ - layer_range: [0, 11]
70
+ model: openai-community/gpt2
71
+ - sources:
72
+ - layer_range: [0, 11]
73
+ model: openai-community/gpt2
74
+ - sources:
75
+ - layer_range: [0, 11]
76
+ model: openai-community/gpt2
77
+ - sources:
78
+ - layer_range: [0, 11]
79
+ model: openai-community/gpt2
80
+ - sources:
81
+ - layer_range: [0, 11]
82
+ model: openai-community/gpt2
83
+ - sources:
84
+ - layer_range: [0, 11]
85
+ model: openai-community/gpt2
86
+ - sources:
87
+ - layer_range: [0, 11]
88
+ model: openai-community/gpt2
89
+ - sources:
90
+ - layer_range: [0, 11]
91
+ model: openai-community/gpt2
92
+ - sources:
93
+ - layer_range: [0, 11]
94
+ model: openai-community/gpt2
95
+ - sources:
96
+ - layer_range: [8, 11]
97
+ model: openai-community/gpt2
98
+ merge_method: passthrough
99
+ dtype: float16
100
+ ```
101
+
102
+ ## 💻 Usage
103
+
104
+ ```python
105
+ !pip install -qU transformers accelerate
106
+
107
+ from transformers import AutoTokenizer
108
+ import transformers
109
+ import torch
110
+
111
+ model = "Kukedlc/GPT2-EXperiment-2"
112
+ messages = [{"role": "user", "content": "What is a large language model?"}]
113
+
114
+ tokenizer = AutoTokenizer.from_pretrained(model)
115
+ prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
116
+ pipeline = transformers.pipeline(
117
+ "text-generation",
118
+ model=model,
119
+ torch_dtype=torch.float16,
120
+ device_map="auto",
121
+ )
122
+
123
+ outputs = pipeline(prompt, max_new_tokens=256, do_sample=True, temperature=0.7, top_k=50, top_p=0.95)
124
+ print(outputs[0]["generated_text"])
125
+ ```
config.json ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_name_or_path": "openai-community/gpt2",
3
+ "activation_function": "gelu_new",
4
+ "architectures": [
5
+ "GPT2LMHeadModel"
6
+ ],
7
+ "attn_pdrop": 0.1,
8
+ "bos_token_id": 50256,
9
+ "embd_pdrop": 0.1,
10
+ "eos_token_id": 50256,
11
+ "initializer_range": 0.02,
12
+ "layer_norm_epsilon": 1e-05,
13
+ "model_type": "gpt2",
14
+ "n_ctx": 1024,
15
+ "n_embd": 768,
16
+ "n_head": 12,
17
+ "n_inner": null,
18
+ "n_layer": 160,
19
+ "n_positions": 1024,
20
+ "reorder_and_upcast_attn": false,
21
+ "resid_pdrop": 0.1,
22
+ "scale_attn_by_inverse_layer_idx": false,
23
+ "scale_attn_weights": true,
24
+ "summary_activation": null,
25
+ "summary_first_dropout": 0.1,
26
+ "summary_proj_to_labels": true,
27
+ "summary_type": "cls_index",
28
+ "summary_use_proj": true,
29
+ "task_specific_params": {
30
+ "text-generation": {
31
+ "do_sample": true,
32
+ "max_length": 50
33
+ }
34
+ },
35
+ "torch_dtype": "float16",
36
+ "transformers_version": "4.44.2",
37
+ "use_cache": true,
38
+ "vocab_size": 50257
39
+ }
mergekit_config.yml ADDED
@@ -0,0 +1,52 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ slices:
3
+ - sources:
4
+ - layer_range: [0, 3]
5
+ model: openai-community/gpt2
6
+ - sources:
7
+ - layer_range: [0, 11]
8
+ model: openai-community/gpt2
9
+ - sources:
10
+ - layer_range: [0, 11]
11
+ model: openai-community/gpt2
12
+ - sources:
13
+ - layer_range: [0, 11]
14
+ model: openai-community/gpt2
15
+ - sources:
16
+ - layer_range: [0, 11]
17
+ model: openai-community/gpt2
18
+ - sources:
19
+ - layer_range: [0, 11]
20
+ model: openai-community/gpt2
21
+ - sources:
22
+ - layer_range: [0, 11]
23
+ model: openai-community/gpt2
24
+ - sources:
25
+ - layer_range: [0, 11]
26
+ model: openai-community/gpt2
27
+ - sources:
28
+ - layer_range: [0, 11]
29
+ model: openai-community/gpt2
30
+ - sources:
31
+ - layer_range: [0, 11]
32
+ model: openai-community/gpt2
33
+ - sources:
34
+ - layer_range: [0, 11]
35
+ model: openai-community/gpt2
36
+ - sources:
37
+ - layer_range: [0, 11]
38
+ model: openai-community/gpt2
39
+ - sources:
40
+ - layer_range: [0, 11]
41
+ model: openai-community/gpt2
42
+ - sources:
43
+ - layer_range: [0, 11]
44
+ model: openai-community/gpt2
45
+ - sources:
46
+ - layer_range: [0, 11]
47
+ model: openai-community/gpt2
48
+ - sources:
49
+ - layer_range: [8, 11]
50
+ model: openai-community/gpt2
51
+ merge_method: passthrough
52
+ dtype: float16
merges.txt ADDED
The diff for this file is too large to render. See raw diff
 
model-00001-of-00001.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d0f137046e154d9b0e1f8416f06725ff30958e0549e30383845656e6d77e6666
3
+ size 2347066888
model.safetensors.index.json ADDED
The diff for this file is too large to render. See raw diff
 
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,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "add_prefix_space": false,
3
+ "added_tokens_decoder": {
4
+ "50256": {
5
+ "content": "<|endoftext|>",
6
+ "lstrip": false,
7
+ "normalized": true,
8
+ "rstrip": false,
9
+ "single_word": false,
10
+ "special": true
11
+ }
12
+ },
13
+ "bos_token": "<|endoftext|>",
14
+ "clean_up_tokenization_spaces": true,
15
+ "eos_token": "<|endoftext|>",
16
+ "model_max_length": 1024,
17
+ "tokenizer_class": "GPT2Tokenizer",
18
+ "unk_token": "<|endoftext|>"
19
+ }
vocab.json ADDED
The diff for this file is too large to render. See raw diff