amitom commited on
Commit
4d1660d
·
verified ·
1 Parent(s): d6ab789

Upload folder using huggingface_hub

Browse files
README.md ADDED
@@ -0,0 +1,61 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ base_model:
3
+ - openai-community/gpt2
4
+ - microsoft/DialoGPT-small
5
+ tags:
6
+ - merge
7
+ - mergekit
8
+ - lazymergekit
9
+ - openai-community/gpt2
10
+ - microsoft/DialoGPT-small
11
+ ---
12
+
13
+ # DialoGPT-gpt2-TIES-DialoHeavy
14
+
15
+ DialoGPT-gpt2-TIES-DialoHeavy is a merge of the following models using [LazyMergekit](https://colab.research.google.com/drive/1obulZ1ROXHjYLn6PPZJwRR6GzgQogxxb?usp=sharing):
16
+ * [openai-community/gpt2](https://huggingface.co/openai-community/gpt2)
17
+ * [microsoft/DialoGPT-small](https://huggingface.co/microsoft/DialoGPT-small)
18
+
19
+ ## 🧩 Configuration
20
+
21
+ ```yaml
22
+ models:
23
+ - model: openai-community/gpt2
24
+ parameters:
25
+ weight: 0.2
26
+ density: 0.8
27
+ - model: microsoft/DialoGPT-small
28
+ parameters:
29
+ weight: 0.8
30
+ density: 1.0
31
+ base_model: microsoft/DialoGPT-small
32
+ merge_method: ties
33
+ dtype: bfloat16
34
+
35
+
36
+ ```
37
+
38
+ ## 💻 Usage
39
+
40
+ ```python
41
+ !pip install -qU transformers accelerate
42
+
43
+ from transformers import AutoTokenizer
44
+ import transformers
45
+ import torch
46
+
47
+ model = "amitom/DialoGPT-gpt2-TIES-DialoHeavy"
48
+ messages = [{"role": "user", "content": "What is a large language model?"}]
49
+
50
+ tokenizer = AutoTokenizer.from_pretrained(model)
51
+ prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
52
+ pipeline = transformers.pipeline(
53
+ "text-generation",
54
+ model=model,
55
+ torch_dtype=torch.float16,
56
+ device_map="auto",
57
+ )
58
+
59
+ outputs = pipeline(prompt, max_new_tokens=256, do_sample=True, temperature=0.7, top_k=50, top_p=0.95)
60
+ print(outputs[0]["generated_text"])
61
+ ```
config.json ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "activation_function": "gelu_new",
3
+ "architectures": [
4
+ "GPT2LMHeadModel"
5
+ ],
6
+ "attn_pdrop": 0.1,
7
+ "bos_token_id": 50256,
8
+ "embd_pdrop": 0.1,
9
+ "eos_token_id": 50256,
10
+ "initializer_range": 0.02,
11
+ "layer_norm_epsilon": 1e-05,
12
+ "model_type": "gpt2",
13
+ "n_ctx": 1024,
14
+ "n_embd": 768,
15
+ "n_head": 12,
16
+ "n_inner": null,
17
+ "n_layer": 12,
18
+ "n_positions": 1024,
19
+ "reorder_and_upcast_attn": false,
20
+ "resid_pdrop": 0.1,
21
+ "scale_attn_by_inverse_layer_idx": false,
22
+ "scale_attn_weights": true,
23
+ "summary_activation": null,
24
+ "summary_first_dropout": 0.1,
25
+ "summary_proj_to_labels": true,
26
+ "summary_type": "cls_index",
27
+ "summary_use_proj": true,
28
+ "task_specific_params": {
29
+ "conversational": {
30
+ "max_length": 1000
31
+ }
32
+ },
33
+ "torch_dtype": "bfloat16",
34
+ "transformers_version": "4.50.3",
35
+ "use_cache": true,
36
+ "vocab_size": 50257
37
+ }
mergekit_config.yml ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ models:
3
+ - model: openai-community/gpt2
4
+ parameters:
5
+ weight: 0.2
6
+ density: 0.8
7
+ - model: microsoft/DialoGPT-small
8
+ parameters:
9
+ weight: 0.8
10
+ density: 1.0
11
+ base_model: microsoft/DialoGPT-small
12
+ merge_method: ties
13
+ dtype: bfloat16
14
+
15
+
merges.txt ADDED
The diff for this file is too large to render. See raw diff
 
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a92f680f61cec6417de1b06be77466fcf37c7e8968d73df2c0495860695a31fa
3
+ size 326089656
special_tokens_map.json ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "bos_token": {
3
+ "content": "<|endoftext|>",
4
+ "lstrip": false,
5
+ "normalized": true,
6
+ "rstrip": false,
7
+ "single_word": false
8
+ },
9
+ "eos_token": {
10
+ "content": "<|endoftext|>",
11
+ "lstrip": false,
12
+ "normalized": true,
13
+ "rstrip": false,
14
+ "single_word": false
15
+ },
16
+ "unk_token": {
17
+ "content": "<|endoftext|>",
18
+ "lstrip": false,
19
+ "normalized": true,
20
+ "rstrip": false,
21
+ "single_word": false
22
+ }
23
+ }
tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
tokenizer_config.json ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "add_bos_token": false,
3
+ "add_prefix_space": false,
4
+ "added_tokens_decoder": {
5
+ "50256": {
6
+ "content": "<|endoftext|>",
7
+ "lstrip": false,
8
+ "normalized": true,
9
+ "rstrip": false,
10
+ "single_word": false,
11
+ "special": true
12
+ }
13
+ },
14
+ "bos_token": "<|endoftext|>",
15
+ "chat_template": "{% for message in messages %}{{ message.content }}{{ eos_token }}{% endfor %}",
16
+ "clean_up_tokenization_spaces": true,
17
+ "eos_token": "<|endoftext|>",
18
+ "errors": "replace",
19
+ "extra_special_tokens": {},
20
+ "model_max_length": 1024,
21
+ "pad_token": null,
22
+ "tokenizer_class": "GPT2Tokenizer",
23
+ "unk_token": "<|endoftext|>"
24
+ }
vocab.json ADDED
The diff for this file is too large to render. See raw diff