初始化项目,由ModelHub XC社区提供模型
Model: GroNLP/gpt2-small-dutch-embeddings Source: Original Platform
This commit is contained in:
10
.gitattributes
vendored
Normal file
10
.gitattributes
vendored
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
*.bin.* filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.lfs.* filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.bin filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.h5 filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.tflite filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.tar.gz filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.ot filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.onnx filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.msgpack filter=lfs diff=lfs merge=lfs -text
|
||||||
|
model.safetensors filter=lfs diff=lfs merge=lfs -text
|
||||||
63
README.md
Normal file
63
README.md
Normal file
@@ -0,0 +1,63 @@
|
|||||||
|
---
|
||||||
|
language: nl
|
||||||
|
tags:
|
||||||
|
- adaption
|
||||||
|
- recycled
|
||||||
|
- gpt2-small
|
||||||
|
pipeline_tag: text-generation
|
||||||
|
---
|
||||||
|
|
||||||
|
# GPT-2 recycled for Dutch (small, adapted lexical embeddings)
|
||||||
|
[Wietse de Vries](https://www.semanticscholar.org/author/Wietse-de-Vries/144611157) •
|
||||||
|
[Malvina Nissim](https://www.semanticscholar.org/author/M.-Nissim/2742475)
|
||||||
|
|
||||||
|
## Model description
|
||||||
|
|
||||||
|
This model is based on the small OpenAI GPT-2 ([`gpt2`](https://huggingface.co/gpt2)) model.
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
|
For details, check out our paper on [arXiv](https://arxiv.org/abs/2012.05628) and the code on [Github](https://github.com/wietsedv/gpt2-recycle).
|
||||||
|
|
||||||
|
|
||||||
|
## Related models
|
||||||
|
|
||||||
|
### Dutch
|
||||||
|
- [`gpt2-small-dutch-embeddings`](https://huggingface.co/GroNLP/gpt2-small-dutch-embeddings): Small model size with only retrained lexical embeddings.
|
||||||
|
- [`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**)
|
||||||
|
- [`gpt2-medium-dutch-embeddings`](https://huggingface.co/GroNLP/gpt2-medium-dutch-embeddings): Medium model size with only retrained lexical embeddings.
|
||||||
|
|
||||||
|
### Italian
|
||||||
|
- [`gpt2-small-italian-embeddings`](https://huggingface.co/GroNLP/gpt2-small-italian-embeddings): Small model size with only retrained lexical embeddings.
|
||||||
|
- [`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**)
|
||||||
|
- [`gpt2-medium-italian-embeddings`](https://huggingface.co/GroNLP/gpt2-medium-italian-embeddings): Medium model size with only retrained lexical embeddings.
|
||||||
|
|
||||||
|
|
||||||
|
## How to use
|
||||||
|
|
||||||
|
```python
|
||||||
|
from transformers import pipeline
|
||||||
|
|
||||||
|
pipe = pipeline("text-generation", model="GroNLP/gpt2-small-dutch-embeddings")
|
||||||
|
```
|
||||||
|
|
||||||
|
```python
|
||||||
|
from transformers import AutoTokenizer, AutoModel, TFAutoModel
|
||||||
|
|
||||||
|
tokenizer = AutoTokenizer.from_pretrained("GroNLP/gpt2-small-dutch-embeddings")
|
||||||
|
model = AutoModel.from_pretrained("GroNLP/gpt2-small-dutch-embeddings") # PyTorch
|
||||||
|
model = TFAutoModel.from_pretrained("GroNLP/gpt2-small-dutch-embeddings") # Tensorflow
|
||||||
|
```
|
||||||
|
|
||||||
|
## BibTeX entry
|
||||||
|
|
||||||
|
```bibtex
|
||||||
|
@misc{devries2020good,
|
||||||
|
title={As good as new. How to successfully recycle English GPT-2 to make models for other languages},
|
||||||
|
author={Wietse de Vries and Malvina Nissim},
|
||||||
|
year={2020},
|
||||||
|
eprint={2012.05628},
|
||||||
|
archivePrefix={arXiv},
|
||||||
|
primaryClass={cs.CL}
|
||||||
|
}
|
||||||
|
```
|
||||||
42
config.json
Executable file
42
config.json
Executable file
@@ -0,0 +1,42 @@
|
|||||||
|
{
|
||||||
|
"_name_or_path": "data/hf/gpt2-small-dutch-embeddings",
|
||||||
|
"activation_function": "gelu_new",
|
||||||
|
"architectures": [
|
||||||
|
"GPT2LMHeadModel"
|
||||||
|
],
|
||||||
|
"attn_pdrop": 0.1,
|
||||||
|
"bos_token_id": 1,
|
||||||
|
"embd_pdrop": 0.1,
|
||||||
|
"eos_token_id": 2,
|
||||||
|
"gradient_checkpointing": false,
|
||||||
|
"initializer_range": 0.02,
|
||||||
|
"layer_norm_epsilon": 1e-05,
|
||||||
|
"model_type": "gpt2",
|
||||||
|
"n_ctx": 1024,
|
||||||
|
"n_embd": 768,
|
||||||
|
"n_head": 12,
|
||||||
|
"n_inner": null,
|
||||||
|
"n_layer": 12,
|
||||||
|
"n_positions": 1024,
|
||||||
|
"pad_token_id": 0,
|
||||||
|
"resid_pdrop": 0.1,
|
||||||
|
"summary_activation": null,
|
||||||
|
"summary_first_dropout": 0.1,
|
||||||
|
"summary_proj_to_labels": true,
|
||||||
|
"summary_type": "cls_index",
|
||||||
|
"summary_use_proj": true,
|
||||||
|
"task_specific_params": {
|
||||||
|
"text-generation": {
|
||||||
|
"do_sample": true,
|
||||||
|
"max_length": 100,
|
||||||
|
"no_repeat_ngram_size": 4,
|
||||||
|
"num_beams": 10,
|
||||||
|
"repetition_penalty": 10.0,
|
||||||
|
"temperature": 2.0,
|
||||||
|
"top_k": 20,
|
||||||
|
"top_p": 0.9
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"use_cache": true,
|
||||||
|
"vocab_size": 40000
|
||||||
|
}
|
||||||
3
flax_model.msgpack
Normal file
3
flax_model.msgpack
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
version https://git-lfs.github.com/spec/v1
|
||||||
|
oid sha256:8eb2e2e576c94a049e56b74febe80b79f5a10c183a9d46db9835d1163cb331bb
|
||||||
|
size 466254616
|
||||||
39835
merges.txt
Normal file
39835
merges.txt
Normal file
File diff suppressed because it is too large
Load Diff
3
model.safetensors
Normal file
3
model.safetensors
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
version https://git-lfs.github.com/spec/v1
|
||||||
|
oid sha256:168b879003d9ba17dad1ed425af25f41936d36457cd60a4e9b866d339c7f79f7
|
||||||
|
size 478850094
|
||||||
3
pytorch_model.bin
Executable file
3
pytorch_model.bin
Executable file
@@ -0,0 +1,3 @@
|
|||||||
|
version https://git-lfs.github.com/spec/v1
|
||||||
|
oid sha256:b4484e5ea43bb2fd62fd5d036158be655bd0eb7229f037f63eee63be2eb37e02
|
||||||
|
size 478894323
|
||||||
1
special_tokens_map.json
Normal file
1
special_tokens_map.json
Normal file
@@ -0,0 +1 @@
|
|||||||
|
{"bos_token": "<s>", "eos_token": "</s>", "unk_token": "<unk>"}
|
||||||
3
tf_model.h5
Normal file
3
tf_model.h5
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
version https://git-lfs.github.com/spec/v1
|
||||||
|
oid sha256:f6ae3bb0523630f580bd720a9aee2807c3b69ada1d4d8ff57087056c9002f846
|
||||||
|
size 466423256
|
||||||
6
tokenizer_config.json
Normal file
6
tokenizer_config.json
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"unk_token": "<unk>",
|
||||||
|
"bos_token": "<s>",
|
||||||
|
"eos_token": "</s>",
|
||||||
|
"add_prefix_space": false
|
||||||
|
}
|
||||||
1
vocab.json
Normal file
1
vocab.json
Normal file
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user