add model files
Browse files- README.md +55 -0
- config.json +44 -0
- merges.txt +0 -0
- pytorch_model.bin +3 -0
- special_tokens_map.json +1 -0
- tf_model.h5 +3 -0
- tokenizer.json +0 -0
- tokenizer_config.json +6 -0
- vocab.json +0 -0
README.md
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
language: nl
|
| 3 |
+
tags:
|
| 4 |
+
- adaption
|
| 5 |
+
- recycled
|
| 6 |
+
- gpt2-medium
|
| 7 |
+
pipeline_tag: text-generation
|
| 8 |
+
---
|
| 9 |
+
|
| 10 |
+
# GPT-2 recycled for Dutch (medium, adapted lexical embeddings)
|
| 11 |
+
[Wietse de Vries](https://www.semanticscholar.org/author/Wietse-de-Vries/144611157) •
|
| 12 |
+
[Malvina Nissim](https://www.semanticscholar.org/author/M.-Nissim/2742475)
|
| 13 |
+
|
| 14 |
+
## Model description
|
| 15 |
+
|
| 16 |
+
This model is based on the medium OpenAI GPT-2 ([`gpt2-medium`](https://huggingface.co/gpt2-medium)) model.
|
| 17 |
+
|
| 18 |
+
The Transformer layer weights in this model are identical to the original English, model but the lexical layer has been retrained for a Dutch vocabulary.
|
| 19 |
+
|
| 20 |
+
For details, check out our paper on [arXiv](https://arxiv.org/abs/XXXX.XXXXX) and the code on [Github](https://github.com/wietsedv/gpt2-recycle).
|
| 21 |
+
|
| 22 |
+
|
| 23 |
+
## Related models
|
| 24 |
+
|
| 25 |
+
### Dutch
|
| 26 |
+
- [`gpt2-small-dutch-embeddings`](https://huggingface.co/GroNLP/gpt2-small-dutch): Small model size with only retrained lexical embeddings.
|
| 27 |
+
- [`gpt2-small-dutch`](https://huggingface.co/GroNLP/gpt2-small-dutch): Small model size with retrained lexical embeddings and additional fine-tuning of the full model. (**Recommended**)
|
| 28 |
+
- [`gpt2-medium-dutch-embeddings`](https://huggingface.co/GroNLP/gpt2-medium-dutch-embeddings): Medium model size with only retrained lexical embeddings.
|
| 29 |
+
|
| 30 |
+
### Italian
|
| 31 |
+
- [`gpt2-small-italian-embeddings`](https://huggingface.co/GroNLP/gpt2-small-italian-embeddings): Small model size with only retrained lexical embeddings.
|
| 32 |
+
- [`gpt2-small-italian`](https://huggingface.co/GroNLP/gpt2-small-italian): Small model size with retrained lexical embeddings and additional fine-tuning of the full model. (**Recommended**)
|
| 33 |
+
- [`gpt2-medium-italian-embeddings`](https://huggingface.co/GroNLP/gpt2-medium-italian-embeddings): Medium model size with only retrained lexical embeddings.
|
| 34 |
+
|
| 35 |
+
|
| 36 |
+
## How to use
|
| 37 |
+
|
| 38 |
+
```python
|
| 39 |
+
from transformers import pipeline
|
| 40 |
+
|
| 41 |
+
pipe = pipeline("text-generation", model="GroNLP/gpt2-medium-dutch-embeddings")
|
| 42 |
+
```
|
| 43 |
+
|
| 44 |
+
```python
|
| 45 |
+
from transformers import AutoTokenizer, AutoModel, TFAutoModel
|
| 46 |
+
|
| 47 |
+
tokenizer = AutoTokenizer.from_pretrained("GroNLP/gpt2-medium-dutch-embeddings")
|
| 48 |
+
model = AutoModel.from_pretrained("GroNLP/gpt2-medium-dutch-embeddings") # PyTorch
|
| 49 |
+
model = TFAutoModel.from_pretrained("GroNLP/gpt2-medium-dutch-embeddings") # Tensorflow
|
| 50 |
+
```
|
| 51 |
+
|
| 52 |
+
## BibTeX entry
|
| 53 |
+
|
| 54 |
+
```bibtex
|
| 55 |
+
```
|
config.json
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"_name_or_path": "data/hf/gpt2-medium-dutch-embeddings",
|
| 3 |
+
"activation_function": "gelu_new",
|
| 4 |
+
"architectures": [
|
| 5 |
+
"GPT2LMHeadModel"
|
| 6 |
+
],
|
| 7 |
+
"attn_pdrop": 0.1,
|
| 8 |
+
"bos_token_id": 1,
|
| 9 |
+
"embd_pdrop": 0.1,
|
| 10 |
+
"eos_token_id": 2,
|
| 11 |
+
"gradient_checkpointing": false,
|
| 12 |
+
"initializer_range": 0.02,
|
| 13 |
+
"layer_norm_epsilon": 1e-05,
|
| 14 |
+
"model_type": "gpt2",
|
| 15 |
+
"n_ctx": 1024,
|
| 16 |
+
"n_embd": 1024,
|
| 17 |
+
"n_head": 16,
|
| 18 |
+
"n_inner": null,
|
| 19 |
+
"n_layer": 24,
|
| 20 |
+
"n_positions": 1024,
|
| 21 |
+
"n_special": 0,
|
| 22 |
+
"pad_token_id": 0,
|
| 23 |
+
"predict_special_tokens": true,
|
| 24 |
+
"resid_pdrop": 0.1,
|
| 25 |
+
"summary_activation": null,
|
| 26 |
+
"summary_first_dropout": 0.1,
|
| 27 |
+
"summary_proj_to_labels": true,
|
| 28 |
+
"summary_type": "cls_index",
|
| 29 |
+
"summary_use_proj": true,
|
| 30 |
+
"task_specific_params": {
|
| 31 |
+
"text-generation": {
|
| 32 |
+
"do_sample": true,
|
| 33 |
+
"max_length": 100,
|
| 34 |
+
"no_repeat_ngram_size": 4,
|
| 35 |
+
"num_beams": 10,
|
| 36 |
+
"repetition_penalty": 10.0,
|
| 37 |
+
"temperature": 2.0,
|
| 38 |
+
"top_k": 20,
|
| 39 |
+
"top_p": 0.9
|
| 40 |
+
}
|
| 41 |
+
},
|
| 42 |
+
"use_cache": true,
|
| 43 |
+
"vocab_size": 40000
|
| 44 |
+
}
|
merges.txt
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
pytorch_model.bin
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:51399e3320de5bf25ba7a541182c8f4f3f579df08ad23e626f5a5dfbb18a6b69
|
| 3 |
+
size 1402567979
|
special_tokens_map.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"bos_token": "<s>", "eos_token": "</s>", "unk_token": "<unk>"}
|
tf_model.h5
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:a311975956e6d86735f2281c4d604306c8e10b12cb7046ca02726c58df3b42f1
|
| 3 |
+
size 1377613384
|
tokenizer.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
tokenizer_config.json
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"unk_token": "<unk>",
|
| 3 |
+
"bos_token": "<s>",
|
| 4 |
+
"eos_token": "</s>",
|
| 5 |
+
"add_prefix_space": false
|
| 6 |
+
}
|
vocab.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|