Upload folder using huggingface_hub
Browse files- README.md +59 -0
- config.json +37 -0
- mergekit_config.yml +13 -0
- merges.txt +0 -0
- model.safetensors +3 -0
- special_tokens_map.json +23 -0
- tokenizer.json +0 -0
- tokenizer_config.json +24 -0
- vocab.json +0 -0
README.md
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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-TA
|
| 14 |
+
|
| 15 |
+
DialoGPT-gpt2-TA 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.6
|
| 26 |
+
- model: microsoft/DialoGPT-small
|
| 27 |
+
parameters:
|
| 28 |
+
weight: 0.4
|
| 29 |
+
base_model: microsoft/DialoGPT-small
|
| 30 |
+
merge_method: task_arithmetic
|
| 31 |
+
dtype: bfloat16
|
| 32 |
+
|
| 33 |
+
|
| 34 |
+
```
|
| 35 |
+
|
| 36 |
+
## 💻 Usage
|
| 37 |
+
|
| 38 |
+
```python
|
| 39 |
+
!pip install -qU transformers accelerate
|
| 40 |
+
|
| 41 |
+
from transformers import AutoTokenizer
|
| 42 |
+
import transformers
|
| 43 |
+
import torch
|
| 44 |
+
|
| 45 |
+
model = "amitom/DialoGPT-gpt2-TA"
|
| 46 |
+
messages = [{"role": "user", "content": "What is a large language model?"}]
|
| 47 |
+
|
| 48 |
+
tokenizer = AutoTokenizer.from_pretrained(model)
|
| 49 |
+
prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
|
| 50 |
+
pipeline = transformers.pipeline(
|
| 51 |
+
"text-generation",
|
| 52 |
+
model=model,
|
| 53 |
+
torch_dtype=torch.float16,
|
| 54 |
+
device_map="auto",
|
| 55 |
+
)
|
| 56 |
+
|
| 57 |
+
outputs = pipeline(prompt, max_new_tokens=256, do_sample=True, temperature=0.7, top_k=50, top_p=0.95)
|
| 58 |
+
print(outputs[0]["generated_text"])
|
| 59 |
+
```
|
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,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
|
| 2 |
+
models:
|
| 3 |
+
- model: openai-community/gpt2
|
| 4 |
+
parameters:
|
| 5 |
+
weight: 0.6
|
| 6 |
+
- model: microsoft/DialoGPT-small
|
| 7 |
+
parameters:
|
| 8 |
+
weight: 0.4
|
| 9 |
+
base_model: microsoft/DialoGPT-small
|
| 10 |
+
merge_method: task_arithmetic
|
| 11 |
+
dtype: bfloat16
|
| 12 |
+
|
| 13 |
+
|
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:35606559bfd836687c4d545a09038f4a3d45934060bd1078ae8c26f94a2b4ad5
|
| 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
|
|
|