初始化项目,由ModelHub XC社区提供模型
Model: GroNLP/gpt2-small-italian 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
|
||||||
61
README.md
Normal file
61
README.md
Normal file
@@ -0,0 +1,61 @@
|
|||||||
|
---
|
||||||
|
language: it
|
||||||
|
tags:
|
||||||
|
- adaption
|
||||||
|
- recycled
|
||||||
|
- gpt2-small
|
||||||
|
pipeline_tag: text-generation
|
||||||
|
---
|
||||||
|
|
||||||
|
# GPT-2 recycled for Italian (small)
|
||||||
|
[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.
|
||||||
|
|
||||||
|
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-italian")
|
||||||
|
```
|
||||||
|
|
||||||
|
```python
|
||||||
|
from transformers import AutoTokenizer, AutoModel, TFAutoModel
|
||||||
|
|
||||||
|
tokenizer = AutoTokenizer.from_pretrained("GroNLP/gpt2-small-italian")
|
||||||
|
model = AutoModel.from_pretrained("GroNLP/gpt2-small-italian") # PyTorch
|
||||||
|
model = TFAutoModel.from_pretrained("GroNLP/gpt2-small-italian") # 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
Normal file
42
config.json
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
{
|
||||||
|
"_name_or_path": "data/hf/gpt2-small-italian",
|
||||||
|
"activation_function": "gelu_new",
|
||||||
|
"architectures": [
|
||||||
|
"GPT2LMHeadModel"
|
||||||
|
],
|
||||||
|
"attn_pdrop": 0.1,
|
||||||
|
"bos_token_id": 0,
|
||||||
|
"embd_pdrop": 0.1,
|
||||||
|
"eos_token_id": 0,
|
||||||
|
"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": 30001
|
||||||
|
}
|
||||||
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:02d4838a934b531a526e7c9a8eaf986d58ff78ca13b1e58c159f4be1aea5a942
|
||||||
|
size 435537688
|
||||||
29744
merges.txt
Normal file
29744
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:4643584408f7733e5410979206b7d627edf324af927c666a9b1d8e688f62f76f
|
||||||
|
size 448133166
|
||||||
3
pytorch_model.bin
Normal file
3
pytorch_model.bin
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
version https://git-lfs.github.com/spec/v1
|
||||||
|
oid sha256:c15f3be2d39b13930b2e019b7c0ba43561d5d3a8eb436d83341cf69def98d1af
|
||||||
|
size 448177414
|
||||||
1
special_tokens_map.json
Normal file
1
special_tokens_map.json
Normal file
@@ -0,0 +1 @@
|
|||||||
|
{"bos_token": "<|endoftext|>", "eos_token": "<|endoftext|>", "unk_token": "<|endoftext|>"}
|
||||||
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:fb991b65bdd4fc738cd53768cb9c8b1c456f6dee7148ae9728233ece5fc23682
|
||||||
|
size 435706328
|
||||||
6
tokenizer_config.json
Normal file
6
tokenizer_config.json
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"unk_token": "<|endoftext|>",
|
||||||
|
"bos_token": "<|endoftext|>",
|
||||||
|
"eos_token": "<|endoftext|>",
|
||||||
|
"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