add model files
Browse files- README.md +53 -0
- config.json +42 -0
- merges.txt +0 -0
- pytorch_model.bin +3 -0
- special_tokens_map.json +1 -0
- tf_model.h5 +3 -0
- tokenizer_config.json +6 -0
- vocab.json +0 -0
README.md
ADDED
@@ -0,0 +1,53 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
language: nl
|
3 |
+
tags:
|
4 |
+
- adaption
|
5 |
+
- recycled
|
6 |
+
- gpt2-small
|
7 |
+
pipeline_tag: text-generation
|
8 |
+
---
|
9 |
+
|
10 |
+
# GPT-2 recycled for Italian (small)
|
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 small OpenAI GPT-2 ([`gpt2`](https://huggingface.co/gpt2)) model.
|
17 |
+
|
18 |
+
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).
|
19 |
+
|
20 |
+
|
21 |
+
## Related models
|
22 |
+
|
23 |
+
### Dutch
|
24 |
+
- [`gpt2-small-dutch-embeddings`](https://huggingface.co/GroNLP/gpt2-small-dutch): Small model size with only retrained lexical embeddings.
|
25 |
+
- [`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**)
|
26 |
+
- [`gpt2-medium-dutch-embeddings`](https://huggingface.co/GroNLP/gpt2-medium-dutch-embeddings): Medium model size with only retrained lexical embeddings.
|
27 |
+
|
28 |
+
### Italian
|
29 |
+
- [`gpt2-small-italian-embeddings`](https://huggingface.co/GroNLP/gpt2-small-italian-embeddings): Small model size with only retrained lexical embeddings.
|
30 |
+
- [`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**)
|
31 |
+
- [`gpt2-medium-italian-embeddings`](https://huggingface.co/GroNLP/gpt2-medium-italian-embeddings): Medium model size with only retrained lexical embeddings.
|
32 |
+
|
33 |
+
|
34 |
+
## How to use
|
35 |
+
|
36 |
+
```python
|
37 |
+
from transformers import pipeline
|
38 |
+
|
39 |
+
pipe = pipeline("text-generation", model="GroNLP/gpt2-small-italian")
|
40 |
+
```
|
41 |
+
|
42 |
+
```python
|
43 |
+
from transformers import AutoTokenizer, AutoModel, TFAutoModel
|
44 |
+
|
45 |
+
tokenizer = AutoTokenizer.from_pretrained("GroNLP/gpt2-small-italian")
|
46 |
+
model = AutoModel.from_pretrained("GroNLP/gpt2-small-italian") # PyTorch
|
47 |
+
model = TFAutoModel.from_pretrained("GroNLP/gpt2-small-italian") # Tensorflow
|
48 |
+
```
|
49 |
+
|
50 |
+
## BibTeX entry
|
51 |
+
|
52 |
+
```bibtex
|
53 |
+
```
|
config.json
ADDED
@@ -0,0 +1,42 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"_name_or_path": "data/hf/gpt2-small-italian",
|
3 |
+
"activation_function": "gelu_new",
|
4 |
+
"architectures": [
|
5 |
+
"GPT2LMHeadModel"
|
6 |
+
],
|
7 |
+
"attn_pdrop": 0.1,
|
8 |
+
"bos_token_id": 0,
|
9 |
+
"embd_pdrop": 0.1,
|
10 |
+
"eos_token_id": 0,
|
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": 768,
|
17 |
+
"n_head": 12,
|
18 |
+
"n_inner": null,
|
19 |
+
"n_layer": 12,
|
20 |
+
"n_positions": 1024,
|
21 |
+
"pad_token_id": 0,
|
22 |
+
"resid_pdrop": 0.1,
|
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 |
+
"text-generation": {
|
30 |
+
"do_sample": true,
|
31 |
+
"max_length": 100,
|
32 |
+
"no_repeat_ngram_size": 4,
|
33 |
+
"num_beams": 10,
|
34 |
+
"repetition_penalty": 10.0,
|
35 |
+
"temperature": 2.0,
|
36 |
+
"top_k": 20,
|
37 |
+
"top_p": 0.9
|
38 |
+
}
|
39 |
+
},
|
40 |
+
"use_cache": true,
|
41 |
+
"vocab_size": 30001
|
42 |
+
}
|
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:c15f3be2d39b13930b2e019b7c0ba43561d5d3a8eb436d83341cf69def98d1af
|
3 |
+
size 448177414
|
special_tokens_map.json
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
{"bos_token": "<|endoftext|>", "eos_token": "<|endoftext|>", "unk_token": "<|endoftext|>"}
|
tf_model.h5
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:fb991b65bdd4fc738cd53768cb9c8b1c456f6dee7148ae9728233ece5fc23682
|
3 |
+
size 435706328
|
tokenizer_config.json
ADDED
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"unk_token": "<|endoftext|>",
|
3 |
+
"bos_token": "<|endoftext|>",
|
4 |
+
"eos_token": "<|endoftext|>",
|
5 |
+
"add_prefix_space": false
|
6 |
+
}
|
vocab.json
ADDED
The diff for this file is too large to render.
See raw diff
|
|