Downloads · 30 days
16
4% of all-time downloads
Kristijan/gpt2_wt103_12-layer
gpt2_wt103_12-layer is a machine learning model from Kristijan. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for pytorch.
paper: Characterizing Verbatim Short-Term Memory in Neural Language Models
Downloads · 30 days
16
4% of all-time downloads
All-time downloads
390
Public
Repo size
1.7 GB
Likes
0
Public
Click a slice to open those files.
.pt862 MB · 66%
From the Hugging Face model README
paper: Characterizing Verbatim Short-Term Memory in Neural Language Models
This is a gpt2-small-like decoder-only transformer model trained on a the wikitext-103 dataset.
You can download and load the model as follows:
from transformers import GPT2LMHeadModel
model = GPT2LMHeadModel.from_pretrained("Kristijan/gpt2_wt103_12-layer")
Alternatively, if you've downloaded the checkpoint files in this repository, you could also do:
from transformers import GPT2LMHeadModel
model = GPT2LMHeadModel.from_pretrained(path_to_folder_with_checkpoint_files)
You should first pretokenize your text using the MosesTokenizer:
from mosestokenizer import MosesTokenizer
with MosesTokenizer('en') as pretokenize:
pretokenized_text = " ".join(pretokenize(text_string))
Then, to BPE tokenize your text for this model, you should use the tokenizer trained on Wikitext-103:
from transformers import GPT2TokenizerFast
tokenizer = GPT2TokenizerFast.from_pretrained("Kristijan/wikitext-103-tokenizer_v2")
tokenized_text = tokenizer.tokenize(pretokenized_text)
This checkpoint is intended for research purposes, for example those interested in studying the behavior of transformer language models trained on smaller datasets.